Skip to content

Commit

Permalink
finish_dialog_test.rb: reset instead of mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Oct 10, 2014
1 parent 2b195a9 commit fe33b94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/finish_dialog_test.rb
Expand Up @@ -23,6 +23,10 @@
stub_const("Yast::Installation", double(:destdir => "/mnt"))
end

after(:each) do
Registration::RepoStateStorage.instance.repositories = []
end

it "do nothing if system is not registered" do
expect(Registration::Registration).to receive(:is_registered?).once.
and_return(false)
Expand Down Expand Up @@ -57,8 +61,7 @@

# changed repository with ID 42, originally enabled
repo_state = Registration::RepoState.new(42, true)
expect(Registration::RepoStateStorage.instance).to receive(:repositories).
and_return([repo_state])
Registration::RepoStateStorage.instance.repositories = [repo_state]
expect(Yast::Pkg).to receive(:SourceSetEnabled).with(42, true)
expect(Yast::Pkg).to receive(:SourceSaveAll)

Expand Down

0 comments on commit fe33b94

Please sign in to comment.