summaryrefslogtreecommitdiff
path: root/test/ruby/test_arity.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-15 01:31:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-15 01:31:43 +0000
commit9f9201b85d282d6f1f1999bfab7ac22b26e2d768 (patch)
tree58a514ba2fa645500ebd4f8b4014414f812eb05d /test/ruby/test_arity.rb
parent724e683e86f19cda02dfe3906fdf5adca539b94b (diff)
* test/ruby/test_arity.rb (TestArity#err_mess): use assert_raise.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_arity.rb')
-rw-r--r--test/ruby/test_arity.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_arity.rb b/test/ruby/test_arity.rb
index 2d84330ffc..18ef9b2d03 100644
--- a/test/ruby/test_arity.rb
+++ b/test/ruby/test_arity.rb
@@ -3,16 +3,16 @@ require 'test/unit'
class TestArity < Test::Unit::TestCase
def err_mess(method_proc = nil, argc = 0)
args = (1..argc).to_a
- case method_proc
+ err = assert_raise(ArgumentError) do
+ case method_proc
when nil
yield
when Symbol
method(method_proc).call(*args)
else
method_proc.call(*args)
+ end
end
- fail "Expected ArgumentError to be raised"
- rescue ArgumentError => err
s = err.to_s
assert s =~ /wrong number of arguments \((.*)\)/, "Unexpected ArgumentError's message: #{s}"
$1