mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
use assert_raise
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
21f2c194bb
commit
ae042f21fb
30 changed files with 100 additions and 100 deletions
|
@ -20,19 +20,19 @@ class TestSingleton < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_initialize_raises_exception
|
||||
assert_raises NoMethodError do
|
||||
assert_raise NoMethodError do
|
||||
SingletonTest.new
|
||||
end
|
||||
end
|
||||
|
||||
def test_allocate_raises_exception
|
||||
assert_raises NoMethodError do
|
||||
assert_raise NoMethodError do
|
||||
SingletonTest.allocate
|
||||
end
|
||||
end
|
||||
|
||||
def test_clone_raises_exception
|
||||
exception = assert_raises TypeError do
|
||||
exception = assert_raise TypeError do
|
||||
SingletonTest.instance.clone
|
||||
end
|
||||
|
||||
|
@ -42,7 +42,7 @@ class TestSingleton < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_dup_raises_exception
|
||||
exception = assert_raises TypeError do
|
||||
exception = assert_raise TypeError do
|
||||
SingletonTest.instance.dup
|
||||
end
|
||||
|
||||
|
@ -54,7 +54,7 @@ class TestSingleton < Test::Unit::TestCase
|
|||
def test_include_in_module_raises_exception
|
||||
mod = Module.new
|
||||
|
||||
exception = assert_raises TypeError do
|
||||
exception = assert_raise TypeError do
|
||||
mod.class_eval do
|
||||
include Singleton
|
||||
end
|
||||
|
@ -66,7 +66,7 @@ class TestSingleton < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_extending_singleton_raises_exception
|
||||
assert_raises NoMethodError do
|
||||
assert_raise NoMethodError do
|
||||
'foo'.extend Singleton
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue