Skip to content

Commit

Permalink
Fix Product#license method
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Apr 5, 2018
1 parent ed20a26 commit f6e2106
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/packages/src/lib/y2packager/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def label
# @param lang [String] Language
# @return [ProductLicense,nil] Product's license; nil if the license was not found.
def license
@license ||= ProductLicense.find(name, :rpm)
@license ||= ProductLicense.find(name, source: :rpm)
end

# Return the license text to be confirmed
Expand Down
12 changes: 12 additions & 0 deletions library/packages/test/y2packager/product_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,18 @@
end
end

describe "#license" do
before do
allow(product).to receive(:license).and_call_original
end

it "returns the product license" do
expect(Y2Packager::ProductLicense).to receive(:find).with(product.name, source: :rpm)
.and_return(product_license)
expect(product.license).to be(product_license)
end
end

describe "#license_content" do
let(:lang) { "en_US" }

Expand Down

0 comments on commit f6e2106

Please sign in to comment.