summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-19 16:02:09 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-19 16:02:09 +0000
commita569165d3e6ef80fef747a33d8c47325e23c4430 (patch)
tree37d4da89d5d430e633941f87c09823fd36646271 /test/ruby
parent1ccf489ad5ecac4c215d65d306e5b38c06657b8f (diff)
merge revision(s) 40205: [Backport #8236]
* compile.c (iseq_compile_each): append keyword hash to argument array to splat if needed. [ruby-core:54094] [Bug #8236] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_keyword.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index 66f9cc8dbb..3107825573 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -290,4 +290,25 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal(1, o.bug7942(), bug7942)
assert_equal(42, o.bug7942(a: 42), bug7942)
end
+
+ def test_super_with_keyword
+ bug8236 = '[ruby-core:54094] [Bug #8236]'
+ base = Class.new do
+ def foo(*args)
+ args
+ end
+ end
+ a = Class.new(base) do
+ def foo(arg, bar: 'x')
+ super
+ end
+ end
+ b = Class.new(base) do
+ def foo(*args, bar: 'x')
+ super
+ end
+ end
+ assert_equal([42, {:bar=>"x"}], a.new.foo(42), bug8236)
+ assert_equal([42, {:bar=>"x"}], b.new.foo(42), bug8236)
+ end
end