Skip to content

Commit

Permalink
convert incomplete language test
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 6, 2020
1 parent 30cf43b commit 72c6f8c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 51 deletions.
22 changes: 22 additions & 0 deletions language/test/Language_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -507,4 +507,26 @@
expect(subject.Summary).to include("<ul>")
end
end

describe "#IncompleteTranslation" do
it "returns true if language translation is lower then threshold" do
allow(Yast::FileUtils).to receive(:Exists).and_return(true)
allow(Yast::SCR).to receive(:Read).and_return("15")
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "incomplete_translation_treshold")
.and_return("90")

expect(subject.IncompleteTranslation("cs_CZ")).to eq true
end

it "returns false otherwise" do
allow(Yast::FileUtils).to receive(:Exists).and_return(true)
allow(Yast::SCR).to receive(:Read).and_return("95")
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "incomplete_translation_treshold")
.and_return("90")

expect(subject.IncompleteTranslation("cs_CZ")).to eq false
end
end
end
Empty file.
8 changes: 0 additions & 8 deletions language/testsuite/tests/IncompleteTranslation.out

This file was deleted.

43 changes: 0 additions & 43 deletions language/testsuite/tests/IncompleteTranslation.rb

This file was deleted.

0 comments on commit 72c6f8c

Please sign in to comment.