mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test: use assert_raise
* test/ruby, test/-ext-: use assert_raise instead of assert_raises. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a28de81aec
commit
289d6bb30f
6 changed files with 10 additions and 10 deletions
|
@ -3,7 +3,7 @@ require '-test-/tracepoint'
|
|||
|
||||
class TestTracepointObj < Test::Unit::TestCase
|
||||
def test_not_available_from_ruby
|
||||
assert_raises ArgumentError do
|
||||
assert_raise ArgumentError do
|
||||
TracePoint.trace(:obj_new){}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,7 +27,7 @@ class TestWaitForSingleFD < Test::Unit::TestCase
|
|||
with_pipe do |r,w|
|
||||
wfd = w.fileno
|
||||
w.close
|
||||
assert_raises(Errno::EBADF) do
|
||||
assert_raise(Errno::EBADF) do
|
||||
IO.wait_for_single_fd(wfd, RB_WAITFD_OUT, nil)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -339,7 +339,7 @@ class TestFile < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_file_open_double_mode
|
||||
e = assert_raises(ArgumentError) { File.open("a", 'w', :mode => 'rw+') }
|
||||
e = assert_raise(ArgumentError) { File.open("a", 'w', :mode => 'rw+') }
|
||||
assert_equal 'mode specified twice', e.message
|
||||
end
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ class TestHash < Test::Unit::TestCase
|
|||
super(Object.new)
|
||||
end
|
||||
}.new
|
||||
assert_raises(TypeError) { h.dup }
|
||||
assert_raise(TypeError) { h.dup }
|
||||
end
|
||||
|
||||
def test_clear_initialize_copy
|
||||
|
|
|
@ -248,7 +248,7 @@ class TestModule < Test::Unit::TestCase
|
|||
":",
|
||||
["String::", "[Bug #7573]"],
|
||||
].each do |name, msg|
|
||||
e = assert_raises(NameError, "#{msg}#{': ' if msg}wrong constant name #{name.dump}") {
|
||||
e = assert_raise(NameError, "#{msg}#{': ' if msg}wrong constant name #{name.dump}") {
|
||||
Object.const_get name
|
||||
}
|
||||
assert_equal("wrong constant name %s" % name, e.message)
|
||||
|
@ -296,7 +296,7 @@ class TestModule < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_nested_bad_class
|
||||
assert_raises(TypeError) do
|
||||
assert_raise(TypeError) do
|
||||
self.class.const_get([User, 'USER', 'Foo'].join('::'))
|
||||
end
|
||||
end
|
||||
|
@ -1656,7 +1656,7 @@ class TestModule < Test::Unit::TestCase
|
|||
@@foo
|
||||
$foo
|
||||
].each do |name|
|
||||
assert_raises(NameError) do
|
||||
assert_raise(NameError) do
|
||||
Module.new { attr_accessor name.to_sym }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -83,7 +83,7 @@ class TestThread < Test::Unit::TestCase
|
|||
def test_thread_variable_frozen
|
||||
t = Thread.new { }.join
|
||||
t.freeze
|
||||
assert_raises(RuntimeError) do
|
||||
assert_raise(RuntimeError) do
|
||||
t.thread_variable_set(:foo, "bar")
|
||||
end
|
||||
end
|
||||
|
@ -748,13 +748,13 @@ _eom
|
|||
end
|
||||
|
||||
def test_thread_join_current
|
||||
assert_raises(ThreadError) do
|
||||
assert_raise(ThreadError) do
|
||||
Thread.current.join
|
||||
end
|
||||
end
|
||||
|
||||
def test_thread_join_main_thread
|
||||
assert_raises(ThreadError) do
|
||||
assert_raise(ThreadError) do
|
||||
Thread.new(Thread.current) {|t|
|
||||
t.join
|
||||
}.join
|
||||
|
|
Loading…
Reference in a new issue