Skip to content

Commit ebe477d

Browse files
committed
Fix all other test issues
1 parent e6cf165 commit ebe477d

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/matrixeval/ruby/variant.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ def default(key, vector)
1010
attr_reader :key, :image, :env, :vector, :default
1111

1212
def initialize(config = {}, vector)
13+
raise Error.new("Variant#key is missing") if config["key"].nil?
14+
1315
@vector = vector
1416
@key = config["key"].to_s
1517
@image = config["image"]
1618
@env = config["env"] || {}
1719
@default = config["default"] || false
18-
19-
raise Error.new("Variant#key is missing") if @key.nil?
2020
end
2121

2222
def bundle_volume_name

test/matrixeval/ruby/context_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ def setup
1313
@sidekiq_5_variant = Matrixeval::Ruby::Variant.new(
1414
{
1515
"key" => "5.0",
16-
"env" => [{"SIDEKIQ_VERSION" => "5.0.0"}]
16+
"env" => {"SIDEKIQ_VERSION" => "5.0.0"}
1717
}, @sidekiq_vector)
1818

1919
@rails_6_variant = Matrixeval::Ruby::Variant.new(
2020
{
2121
"key" => "6.1",
22-
"env" => [{"RAILS_VERSION" => "6.1.0"}]
22+
"env" => {"RAILS_VERSION" => "6.1.0"}
2323
}, @rails_vector)
2424

2525
@context = Matrixeval::Ruby::Context.new(

test/matrixeval/ruby/docker_compose/yaml_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def setup
1212
def test_create
1313
refute File.exist?(dummy_gem_docker_compose_file_path)
1414

15-
Matrixeval::Ruby::Config::YAML.stubs(:parse).returns({
15+
Matrixeval::Ruby::Config::YAML.stubs(:yaml).returns({
1616
"version" => "0.1",
1717
"target" => "ruby",
1818
"matrix" => {

test/matrixeval/ruby/variant_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def setup
1010

1111
def test_key
1212
variant = Matrixeval::Ruby::Variant.new({"key" => 3.1}, @vector)
13-
assert_equal 3.1, variant.key
13+
assert_equal "3.1", variant.key
1414
end
1515

1616
def test_key_missing
@@ -21,12 +21,12 @@ def test_key_missing
2121

2222
def test_image
2323
variant = Matrixeval::Ruby::Variant.new({"key" => 3.1, "image" => "ruby:3.1.0"}, @vector)
24-
assert_equal 3.1, variant.key
24+
assert_equal "3.1", variant.key
2525
end
2626

2727
def test_env
2828
variant = Matrixeval::Ruby::Variant.new({"key" => 3.1}, @vector)
29-
assert_equal {}, variant.env
29+
assert_equal({}, variant.env)
3030
end
3131

3232
def test_vector

0 commit comments

Comments
 (0)