Skip to content

Commit

Permalink
changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 7, 2020
1 parent d1e64ba commit 3fd991b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
22 changes: 19 additions & 3 deletions language/test/Language_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
expect(subject.Export).to include("languages" => "cs_CZ,en_US")
end

it "returns map with use_uth8 if utf is not used" do
it "returns map with use_utf8 if utf is not used" do
subject.SetExpertValues("use_utf8" => false)
expect(subject.Export).to include("use_utf8" => false)
end
Expand Down Expand Up @@ -498,7 +498,23 @@
expect(subject.languages).to eq "cs_CZ,de_DE"
end

# TODO: Autoinst specific behavior
context "in autoinstallation" do
before do
allow(Yast::Mode).to receive(:autoinst).and_return(true)
end

it "sets package locale to imported language" do
expect(Yast::Pkg).to receive(:SetPackageLocale).with("de_DE")

subject.Import("language" => "de_DE")
end

it "sets additional locales to imported languages" do
expect(Yast::Pkg).to receive(:SetAdditionalLocales).with(["de_DE", "cs_CZ"])

subject.Import("languages" => "de_DE,cs_CZ", "language" => "de_DE")
end
end
end

describe "#Summary" do
Expand All @@ -509,7 +525,7 @@
end

describe "#IncompleteTranslation" do
it "returns true if language translation is lower then threshold" do
it "returns true if language translation is lower than 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)
Expand Down
6 changes: 3 additions & 3 deletions timezone/src/modules/Timezone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def GetDateTime(real_time, locale_format)
ds = 0
if @diff != 0
out2 = Convert.to_map(
SCR.Execute(path(".target.bash_output"), "/bin/date +%z")
SCR.Execute(path(".target.bash_output"), "/usr/bin/date +%z")
)
tzd = Ops.get_string(out2, "stdout", "")
log.info("GetDateTime tzd: #{tzd}")
Expand All @@ -656,12 +656,12 @@ def GetDateTime(real_time, locale_format)
end
cmd = tz_prefix +
Builtins.sformat(
"/bin/date \"%1\" \"--date=now %2sec\"",
"/usr/bin/date \"%1\" \"--date=now %2sec\"",
date_format,
Ops.multiply(ds, @diff)
)
else
cmd = Builtins.sformat("/bin/date \"%1\"", date_format)
cmd = Builtins.sformat("/usr/bin/date \"%1\"", date_format)
end
log.info("GetDateTime cmd: #{cmd}")
out = Convert.to_map(SCR.Execute(path(".target.bash_output"), cmd))
Expand Down

0 comments on commit 3fd991b

Please sign in to comment.