diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-29 03:06:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-29 03:06:02 +0000 |
commit | a65982f00fe9bc569d44eeaba85400dc000ffd28 (patch) | |
tree | 469547cad05410330058fdc37e677d7724a23206 | |
parent | 07fb750fd067b5dceb64fd9965473d07d8bd2602 (diff) | |
download | ruby-a65982f00fe9bc569d44eeaba85400dc000ffd28.tar.gz |
test_keyword.rb: assert_raise_with_message value
* test/ruby/test_keyword.rb (test_block_required_keyword):
assert_raise_with_message returns the raised exception object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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) |