Skip to content

Commit

Permalink
Mock Pkg, improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Aug 23, 2016
1 parent 049ac18 commit 6bb0a5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/inst_complex_welcome_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# null object returned above as parameter and it raise exception from
# component system
stub_const("Yast::UI", double.as_null_object)
allow(Yast::Pkg).to receive(:SourceGetCurrent).and_return([])
end

after do
Expand Down
1 change: 1 addition & 0 deletions test/inst_finish_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

allow(Yast::Pkg).to receive(:TargetInitialize)
allow(Yast::Pkg).to receive(:TargetLoad)
allow(Yast::Pkg).to receive(:PkgInstalled).and_return(false)

allow(Yast::Hooks).to receive(:run)
end
Expand Down
5 changes: 4 additions & 1 deletion test/update_repository_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@
end

describe "#cleanup" do
it "deletes the repository" do
it "deletes the repository and releases it" do
expect(Yast::Pkg).to receive(:SourceDelete).with(repo_id)
expect(Yast::Pkg).to receive(:SourceReleaseAll)
expect(Yast::Pkg).to receive(:SourceSaveAll)

subject.cleanup
end
end
Expand Down

0 comments on commit 6bb0a5a

Please sign in to comment.