diff --git a/spec/ruby/language/pattern_matching_spec.rb b/spec/ruby/language/pattern_matching_spec.rb index e9fc4f557d..c6a3008458 100644 --- a/spec/ruby/language/pattern_matching_spec.rb +++ b/spec/ruby/language/pattern_matching_spec.rb @@ -1138,12 +1138,15 @@ ruby_version_is "2.7" do ruby_version_is "3.1" do it "can omit parentheses in one line pattern matching" do - [1, 2] => a, b - a.should == 1 - b.should == 2 + eval(<<~RUBY).should == [1, 2] + [1, 2] => a, b + [a, b] + RUBY - {a: 1} => a: - a.should == 1 + eval(<<~RUBY).should == 1 + {a: 1} => a: + a + RUBY end end end