ruby-changes:44848
From: nobu <ko1@a...>
Date: Tue, 29 Nov 2016 12:06:08 +0900 (JST)
Subject: [ruby-changes:44848] nobu:r56921 (trunk): test_keyword.rb: assert_raise_with_message value
nobu 2016-11-29 12:06:02 +0900 (Tue, 29 Nov 2016) New Revision: 56921 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56921 Log: 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. Modified files: trunk/test/ruby/test_keyword.rb Index: test/ruby/test_keyword.rb =================================================================== --- test/ruby/test_keyword.rb (revision 56920) +++ test/ruby/test_keyword.rb (revision 56921) @@ -371,12 +371,8 @@ class TestKeywordArguments < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L371 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/