Skip to content

Commit

Permalink
Fixed mocking of modification status
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Jun 15, 2016
1 parent 57ccc88 commit 0be5e01
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/lan_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,18 @@
end

describe "LanClass#Modified" do
def reset_modification_statuses
allow(Yast::LanItems).to receive(:GetModified).and_return false
allow(Yast::DNS).to receive(:modified).and_return false
allow(Yast::Routing).to receive(:Modified).and_return false
allow(Yast::NetworkConfig).to receive(:Modified).and_return false
allow(Yast::NetworkService).to receive(:Modified).and_return false
allow(Yast::SuSEFirewall).to receive(:GetModified).and_return false
end

def expect_modification_succeedes(modname, method)
reset_modification_statuses

allow(modname)
.to receive(method)
.and_return true
Expand Down

0 comments on commit 0be5e01

Please sign in to comment.