diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_call.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb index b7d62ae111..ffbda1fdb9 100644 --- a/test/ruby/test_call.rb +++ b/test/ruby/test_call.rb @@ -374,6 +374,21 @@ class TestCall < Test::Unit::TestCase assert_equal({splat_modified: false}, b) end + def test_kwsplat_block_eval_order + def self.t(**kw, &b) [kw, b] end + + pr = ->{} + h = {a: pr} + a = [] + + ary = t(**h, &h.delete(:a)) + assert_equal([{a: pr}, pr], ary) + + h = {a: pr} + ary = t(*a, **h, &h.delete(:a)) + assert_equal([{a: pr}, pr], ary) + end + def test_kwsplat_block_order o = Object.new ary = [] |
