aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_keyword.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r--test/ruby/test_keyword.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index e5c6da44c2..25337712fe 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -2664,6 +2664,10 @@ class TestKeywordArguments < Test::Unit::TestCase
baz(*args)
end
+ def pass_bar(*args)
+ bar(*args)
+ end
+
def bar(*args, **kw)
[args, kw]
end
@@ -2907,6 +2911,10 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal([1, h1], o.baz(1, h1))
assert_equal([h1], o.baz(h1, **{}))
+ assert_warn(/The last argument is used as the keyword parameter.* for `bar'/m) do
+ assert_equal([[1], h1], o.foo(:pass_bar, 1, :a=>1))
+ end
+
assert_warn(/Skipping set of ruby2_keywords flag for bar \(method accepts keywords or method does not accept argument splat\)/) do
assert_nil(c.send(:ruby2_keywords, :bar))
end