summaryrefslogtreecommitdiff
path: root/lib/test
diff options
context:
space:
mode:
authorntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-08 15:58:41 +0000
committerntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-08 15:58:41 +0000
commit1253665ec4406c8972569abf680cc910319b3215 (patch)
tree1f9622978441f8753412d6e09587a73bb2684e3c /lib/test
parentaf2dc0030084bc68355ea4ff2d599be311480249 (diff)
* lib/test/unit/assertions.rb: renamed #assert_raises to #assert_raise
and made the former call the latter. [ruby-core:01890] * test/testunit/test_assertions.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test')
-rw-r--r--lib/test/unit/assertions.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index 3076b7fd02..090a07a405 100644
--- a/lib/test/unit/assertions.rb
+++ b/lib/test/unit/assertions.rb
@@ -56,9 +56,9 @@ EOT
assert_block(full_message) { expected == actual }
end
- # Passes if block raises exception.
+ # Passes if block raises one of the given exceptions.
public
- def assert_raises(*args)
+ def assert_raise(*args)
_wrap_assertion do
if Class === args.last
message = ""
@@ -85,6 +85,12 @@ EOT
end
end
+ # Alias of assert_raise. Will be deprecated in 1.9, and removed in 2.0.
+ public
+ def assert_raises(*args, &block)
+ assert_raise(*args, &block)
+ end
+
# Passes if object.class == klass.
public
def assert_instance_of(klass, object, message="")