Skip to content

Commit

Permalink
Use the new license API.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator authored and imobachgs committed Apr 5, 2018
1 parent 2ddb9f2 commit 8956bc5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/y2packager/clients/inst_product_license.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def multi_product_media?
#
# @return [Boolean] true if the license is available; false otherwise.
def available_license?
return true if product && product.license?(Yast::Language.language)
return true if product && product.license?
if product.nil?
log.warn "No base product is selected for installation"
else
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2packager/widgets/product_license_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def update_license_text
#
# @return [String] Formatted license text
def formatted_license_text
text = product.license(language)
text = product.license_content(language)
if RICHTEXT_REGEXP =~ text
text
else
Expand Down
6 changes: 3 additions & 3 deletions test/lib/widgets/product_license_content_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
subject(:widget) { described_class.new(product, language) }

let(:language) { "de_DE" }
let(:product) { instance_double(Y2Packager::Product, license: "content") }
let(:product) { instance_double(Y2Packager::Product, license_content: "content") }

describe "#contents" do
it "includes license content in the given language" do
expect(product).to receive(:license).with(language)
expect(product).to receive(:license_content).with(language)
.and_return("license content")
widget.contents
end
Expand All @@ -36,7 +36,7 @@
let(:richtext) { CWM::RichText.new }

before do
allow(product).to receive(:license).with("es_ES")
allow(product).to receive(:license_content).with("es_ES")
.and_return("content es_ES")
allow(CWM::RichText).to receive(:new).and_return(richtext)
end
Expand Down

0 comments on commit 8956bc5

Please sign in to comment.