summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_lambda.rb6
-rw-r--r--test/ruby/test_yield.rb2
2 files changed, 7 insertions, 1 deletions
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb
index 826bfcf203..3ac2e4cb98 100644
--- a/test/ruby/test_lambda.rb
+++ b/test/ruby/test_lambda.rb
@@ -101,6 +101,12 @@ class TestLambdaParameters < Test::Unit::TestCase
assert_equal(:ok, x, bug13090)
end
+ def test_arity_error
+ assert_raise(ArgumentError, '[Bug #12705]') do
+ [1, 2].tap(&lambda {|a, b|})
+ end
+ end
+
def foo
assert_equal(nil, ->(&b){ b }.call)
end
diff --git a/test/ruby/test_yield.rb b/test/ruby/test_yield.rb
index 0690d3cdf4..9b2b2f37e0 100644
--- a/test/ruby/test_yield.rb
+++ b/test/ruby/test_yield.rb
@@ -245,7 +245,7 @@ class TestRubyYieldGen < Test::Unit::TestCase
throw :emuerror, ArgumentError
end
else
- if args.length != params.length and !(args.length == 1 and Array === args[0] and args[0].length == params.length)
+ if args.length != params.length
throw :emuerror, ArgumentError
end
end