Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 24, 2025
1 parent bc47b7f commit 91bc0c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions service/lib/agama/autoyast/scripts_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ScriptsReader
# @param profile [ProfileHash] AutoYaST profile
def initialize(profile)
@profile = profile
@anonymous_counter=0
@anonymous_counter = 0
end

# Returns a hash that corresponds to Agama "scripts" section.
Expand Down Expand Up @@ -101,7 +101,7 @@ def read_init_scripts
# @param section [Hash] AutoYaST script section
def read_script(section)
script = {
"name" => section["filename"] || "annonymous#{@anonymous_counter+=1}"
"name" => section["filename"] || "annonymous#{@anonymous_counter += 1}"
}

if section["location"] && !section["location"].empty?
Expand Down
10 changes: 6 additions & 4 deletions service/test/agama/autoyast/converter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

it "evaluates the ERB code" do
subject.to_agama(workdir)
expect(result["l10n"]).to include(
expect(result["localization"]).to include(
"languages" => ["en_US.UTF-8", "es_ES.UTF-8"]
)
end
Expand Down Expand Up @@ -158,9 +158,9 @@
end
end

it "exports l10n settings" do
it "exports localization settings" do
subject.to_agama(workdir)
expect(result["l10n"]).to include(
expect(result["localization"]).to include(
"languages" => ["en_US.UTF-8"],
"timezone" => "Atlantic/Canary",
"keyboard" => "us"
Expand Down Expand Up @@ -197,7 +197,9 @@
)

# filter out deprecation warning as check-jsonschema is not packaged for TW yet
result = `jsonschema -i '#{result_path}' '#{schema}' 2>&1 | grep -v 'DeprecationWarning'`
result = `jsonschema -i '#{result_path}' '#{schema}' 2>&1 | \
grep -v 'DeprecationWarning' | \
grep -v 'from jsonschema.cli import main'`
expect(result).to eq ""
end
end
Expand Down
6 changes: 2 additions & 4 deletions service/test/agama/autoyast/l10n_reader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
{}
end

let(:l10n) { subject.read["localization"] }

subject do
described_class.new(Yast::ProfileHash.new(profile))
end
Expand All @@ -49,7 +51,6 @@
end

it "includes a 'keyboard' key with its value" do
l10n = subject.read["l10n"]
expect(l10n["keyboard"]).to eq("us")
end
end
Expand All @@ -65,7 +66,6 @@
end

it "includes a 'languages' key with all the languages" do
l10n = subject.read["l10n"]
expect(l10n["languages"]).to eq(["en_US.UTF-8", "es_ES.UTF-8", "cs_CZ.UTF-8"])
end

Expand All @@ -80,7 +80,6 @@
end

it "uses the UTF-8 encoding" do
l10n = subject.read["l10n"]
expect(l10n["languages"]).to eq(["en_US.UTF-8", "es_ES.UTF-8"])
end
end
Expand All @@ -92,7 +91,6 @@
end

it "includes a 'keyboard' key with its value" do
l10n = subject.read["l10n"]
expect(l10n["timezone"]).to eq("Europe/Berlin")
end
end
Expand Down

0 comments on commit 91bc0c3

Please sign in to comment.