Skip to content

Commit 782277e

Browse files
committed
Fix a Context#match_exclusion issue
1 parent 2d4bd68 commit 782277e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/matrixeval/ruby/context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def match_exclusion?(exclusion)
6161
variants.all? do |variant|
6262
vector_key = variant.vector.key
6363
if exclusion.key?(vector_key)
64-
exclusion[vector_key] == variant.key
64+
exclusion[vector_key].to_s == variant.key
6565
else
6666
true
6767
end

test/matrixeval/ruby/context_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ def test_variants
7575
end
7676

7777
def test_match_exclusion
78-
assert @context.match_exclusion?({ "ruby" => "3.0", "rails" => "6.1" })
79-
assert @context.match_exclusion?({ "ruby" => "3.0", "rails" => "6.1", "sidekiq" => "5.0" })
78+
assert @context.match_exclusion?({ "ruby" => 3.0, "rails" => "6.1" })
79+
assert @context.match_exclusion?({ "ruby" => "3.0", "rails" => 6.1, "sidekiq" => "5.0" })
8080
assert @context.match_exclusion?({ "rails" => "6.1", "sidekiq" => "5.0" })
81-
refute @context.match_exclusion?({ "ruby" => "2.7", "rails" => "6.1" })
81+
refute @context.match_exclusion?({ "ruby" => 2.7, "rails" => "6.1" })
8282
refute @context.match_exclusion?({ "sidekiq" => "6.0"})
8383
refute @context.match_exclusion?({})
8484
end

0 commit comments

Comments
 (0)