Skip to content

Commit

Permalink
Merge pull request #568 from agrare/fix_awesome_spawn_launch_stub
Browse files Browse the repository at this point in the history
Fix stubbing of AwesomeSpawn private method results
  • Loading branch information
Fryguy authored Nov 2, 2023
2 parents 283c865 + 561c32a commit 4c4222a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/util/miq-system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@
]

stub_const("Sys::Platform::IMPL", :macosx)
expect(AwesomeSpawn).to receive(:launch).and_return([mac_df_output, "", 0])

expect(AwesomeSpawn)
.to receive(:run)
.with("df", {:params => ["-ki", "-l"]})
.and_return(AwesomeSpawn::CommandResult.new("abcd", mac_df_output, "", 123, 0))
expect(described_class.disk_usage).to eq(expected)
end
end
Expand Down

0 comments on commit 4c4222a

Please sign in to comment.