We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
in {}
in {**nil}
1 parent 3406d1d commit 5eab6baCopy full SHA for 5eab6ba
spec/ruby/language/pattern_matching_spec.rb
@@ -1256,6 +1256,37 @@ def obj.deconstruct_keys(*args)
1256
RUBY
1257
end
1258
1259
+ it "in {} only matches empty hashes" do
1260
+ eval(<<~RUBY).should == false
1261
+ case {a: 1}
1262
+ in {}
1263
+ true
1264
+ else
1265
+ false
1266
+ end
1267
+ RUBY
1268
1269
+
1270
+ it "in {**nil} only matches empty hashes" do
1271
+ eval(<<~RUBY).should == true
1272
+ case {}
1273
+ in {**nil}
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
it "matches anything with **" do
1291
eval(<<~RUBY).should == true
1292
case {a: 1}
0 commit comments