Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase test coverage #22

Open
1 of 9 tasks
postmodern opened this issue Jan 21, 2022 · 0 comments
Open
1 of 9 tasks

Increase test coverage #22

postmodern opened this issue Jan 21, 2022 · 0 comments
Labels
good first issue Good for newcomers help-wanted Extra attention is needed tests Tests

Comments

@postmodern
Copy link
Member

Add more tests for the various classes:

  • Ronin::PostEx::System
  • Ronin::PostEx::System::FS
  • Ronin::PostEx::System::Process
  • Ronin::PostEx::System::Shell
  • Ronin::PostEx::Resource
  • Ronin::PostEx::File
  • Ronin::PostEx::File::Stat
  • Ronin::PostEx::Dir
  • Ronin::PostEx::Command

Methods that rely on the Post-Exploitation API methods (ex: fs_read, etc) can easily be tested by stubbing the methods:

Example:

  let(:api) { double('Post-Exploitation API Object') }

  subject { described_class.new(api) }

  describe "#time" do
    let(:unix_timestamp) { 1642775495 }
    let(:time)           { Time.at(unix_timestamp) }

    it "must call the 'sys_time' API function and return a Time object" do
      expect(api).to receive(:sys_time).and_return(unix_timestamp)

      expect(subject.time).to eq(time)
    end
  end
@postmodern postmodern transferred this issue from ronin-rb/ronin-core Jan 21, 2022
@postmodern postmodern added help-wanted Extra attention is needed tests Tests labels Jan 21, 2022
@postmodern postmodern added this to the 0.1.0 milestone Jan 21, 2022
@postmodern postmodern removed this from the 0.1.0 milestone Feb 3, 2023
@postmodern postmodern added the good first issue Good for newcomers label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help-wanted Extra attention is needed tests Tests
Projects
None yet
Development

No branches or pull requests

1 participant