Skip to content

Commit

Permalink
Reduce test duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Apr 11, 2018
1 parent 8f648e9 commit c4505b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/addon_product_test.rb
Expand Up @@ -300,6 +300,10 @@
before do
allow(subject).to receive(:AcceptedLicenseAndInfoFile).and_return(true)
allow(Yast::Pkg).to receive(:SourceProductData).with(repo_id)
allow(Yast::Pkg).to receive(:ResolvableInstall).with("available_product",
:product).and_return(true)
allow(Yast::Pkg).to receive(:ResolvableInstall).with("not_available_product",
:product).and_return(false)
allow(subject).to receive(:ReIntegrateFromScratch)
allow(subject).to receive(:Integrate)
allow(subject).to receive(:AddRepo).with(repo["url"], repo["path"], repo["priority"])
Expand All @@ -321,10 +325,6 @@
end

it "reports an error for none existing products" do
expect(Yast::Pkg).to receive(:ResolvableInstall).with("available_product",
:product).and_return(true)
expect(Yast::Pkg).to receive(:ResolvableInstall).with("not_available_product",
:product).and_return(false)
expect(Yast::Report).to receive(:Error)
.with(format(_("Product %s not found on media."), "not_available_product"))
subject.AddPreselectedAddOnProducts(filelist)
Expand Down

0 comments on commit c4505b3

Please sign in to comment.