diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test/unit/assertions.rb | 10 |
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="") |