summaryrefslogtreecommitdiffstats
path: root/lib
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
commitfad980a7d34ffe8571a373a4d548a403ae9dea5d (patch)
tree1f9622978441f8753412d6e09587a73bb2684e3c /lib
parente075097587988a44b4b26ba4ff7addc93e601728 (diff)
downloadruby-fad980a7d34ffe8571a373a4d548a403ae9dea5d.tar.gz
ruby-fad980a7d34ffe8571a373a4d548a403ae9dea5d.tar.xz
ruby-fad980a7d34ffe8571a373a4d548a403ae9dea5d.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@5141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-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 3076b7fd0..090a07a40 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="")