diff options
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_method.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index c95eec175e..7f20bf5a95 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -336,6 +336,21 @@ assert_equal '[[:ok1, :foo], [:ok2, :foo, :bar]]', $ary } +# with +assert_equal '[:ok1, [:ok2, 11]]', %q{ + class C + def [] + $ary << :ok1 + 10 + end + def []=(a) + $ary << [:ok2, a] + end + end + $ary = [] + C.new[]+=1 + $ary +} # splat and block arguments assert_equal %q{[[[:x, :y, :z], NilClass], [[1, :x, :y, :z], NilClass], [[1, 2, :x, :y, :z], NilClass], [[:obj], NilClass], [[1, :obj], NilClass], [[1, 2, :obj], NilClass], [[], Proc], [[1], Proc], [[1, 2], Proc], [[], Proc], [[1], Proc], [[1, 2], Proc], [[:x, :y, :z], Proc], [[1, :x, :y, :z], Proc], [[1, 2, :x, :y, :z], Proc]]}, %q{ |