diff options
-rw-r--r-- | test/ruby/test_keyword.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index b8ca84c27e..13c728e8fd 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -371,12 +371,8 @@ class TestKeywordArguments < Test::Unit::TestCase break eval("proc {|a:| a}", nil, 'xyzzy', __LINE__) end assert_raise_with_message(ArgumentError, /missing keyword/, feature7701) {b.call} - assert_raise_with_message(ArgumentError, /unknown keyword/, feature7701) {b.call(a:0, b:1)} - begin - b.call(a: 0, b: 1) - rescue => e - assert_equal('xyzzy', e.backtrace_locations[0].path) - end + e = assert_raise_with_message(ArgumentError, /unknown keyword/, feature7701) {b.call(a:0, b:1)} + assert_equal('xyzzy', e.backtrace_locations[0].path) assert_equal(42, b.call(a: 42), feature7701) assert_equal([[:keyreq, :a]], b.parameters, feature7701) |