Skip to content

Commit

Permalink
fix mocking in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Mar 22, 2019
1 parent 2848e97 commit be16c36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/lib/y2network/proposal_settings_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
def stub_features(features)
Yast.import "ProductFeatures"
Yast::ProductFeatures.Import(features)
# stub restore as during Stage normal it restores features
allow(Yast::ProductFeatures).to receive(:Restore)
end

describe ".instance" do
Expand Down Expand Up @@ -121,7 +123,7 @@ def stub_features(features)

it "initializes the default network backend from the product control file" do
expect(subject.default_backend).to eql(:network_manager)
stub_features("network" => { "network_manager" => "" })
stub_features("network" => { "network_manager" => "", "network_manager_is_default" => false })
expect(subject.default_backend).to eql(:wicked)
end
end
Expand Down
1 change: 1 addition & 0 deletions test/lib/y2remote/remote_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
allow(subject).to receive(:modes).and_return(modes)
allow(Yast2::Systemd::Target).to receive(:set_default)
allow(display_manager).to receive(:restart)
allow(Y2Remote::Modes).to receive(:restart_modes)
end

context "when vnc is enabled" do
Expand Down

0 comments on commit be16c36

Please sign in to comment.