summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/digest/test_digest_extend.rb2
-rw-r--r--test/io/wait/test_io_wait.rb2
-rw-r--r--test/logger/test_logdevice.rb2
-rw-r--r--test/net/http/test_http.rb2
-rw-r--r--test/net/http/test_httpresponse.rb2
-rw-r--r--test/net/smtp/test_smtp.rb6
-rw-r--r--test/net/smtp/test_ssl_socket.rb6
-rw-r--r--test/open-uri/test_open-uri.rb2
-rw-r--r--test/openssl/test_asn1.rb2
-rw-r--r--test/openssl/test_buffering.rb2
-rw-r--r--test/openssl/test_digest.rb2
-rw-r--r--test/openssl/test_pkcs12.rb6
-rw-r--r--test/openssl/test_pkey_dh.rb2
-rw-r--r--test/optparse/test_acceptable.rb42
-rw-r--r--test/rexml/test_changing_encoding.rb4
-rw-r--r--test/rexml/test_entity.rb4
-rw-r--r--test/ruby/test_gc.rb2
-rw-r--r--test/socket/test_nonblock.rb2
-rw-r--r--test/socket/test_socket.rb4
-rw-r--r--test/socket/test_tcp.rb4
-rw-r--r--test/socket/test_udp.rb4
-rw-r--r--test/socket/test_unix.rb4
-rw-r--r--test/test_ipaddr.rb22
-rw-r--r--test/test_prime.rb2
-rw-r--r--test/test_set.rb38
-rw-r--r--test/test_singleton.rb12
-rw-r--r--test/test_syslog.rb6
-rw-r--r--test/webrick/test_server.rb2
-rw-r--r--test/xmlrpc/test_client.rb8
-rw-r--r--test/zlib/test_zlib.rb2
30 files changed, 100 insertions, 100 deletions
diff --git a/test/digest/test_digest_extend.rb b/test/digest/test_digest_extend.rb
index adc5613..46158a6 100644
--- a/test/digest/test_digest_extend.rb
+++ b/test/digest/test_digest_extend.rb
@@ -151,7 +151,7 @@ class TestDigestExtend < Test::Unit::TestCase
end
def test_block_length
- assert_raises(RuntimeError) do
+ assert_raise(RuntimeError) do
@MyDigest.new.block_length
end
end
diff --git a/test/io/wait/test_io_wait.rb b/test/io/wait/test_io_wait.rb
index 60886e0..48f6cf5 100644
--- a/test/io/wait/test_io_wait.rb
+++ b/test/io/wait/test_io_wait.rb
@@ -97,7 +97,7 @@ class TestIOWait < Test::Unit::TestCase
def test_wait_writable_closed
@w.close
- assert_raises(IOError) { @w.wait_writable }
+ assert_raise(IOError) { @w.wait_writable }
end
private
diff --git a/test/logger/test_logdevice.rb b/test/logger/test_logdevice.rb
index a563635..becf531 100644
--- a/test/logger/test_logdevice.rb
+++ b/test/logger/test_logdevice.rb
@@ -37,7 +37,7 @@ class TestLogDevice < Test::Unit::TestCase
logdev = d(STDERR)
assert_equal(STDERR, logdev.dev)
assert_nil(logdev.filename)
- assert_raises(TypeError) do
+ assert_raise(TypeError) do
d(nil)
end
#
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index b72aadd..1bd085a 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -899,7 +899,7 @@ class TestNetHTTPKeepAlive < Test::Unit::TestCase
end
start {|http|
- assert_raises(EOFError, Errno::ECONNRESET, IOError) {
+ assert_raise(EOFError, Errno::ECONNRESET, IOError) {
http.get('/')
}
}
diff --git a/test/net/http/test_httpresponse.rb b/test/net/http/test_httpresponse.rb
index 0193a15..ba8b45e 100644
--- a/test/net/http/test_httpresponse.rb
+++ b/test/net/http/test_httpresponse.rb
@@ -253,7 +253,7 @@ Connection: close
hello
EOS
- assert_raises Net::HTTPBadResponse do
+ assert_raise Net::HTTPBadResponse do
Net::HTTPResponse.read_new(io)
end
end
diff --git a/test/net/smtp/test_smtp.rb b/test/net/smtp/test_smtp.rb
index 748b20d..d8bb0c1 100644
--- a/test/net/smtp/test_smtp.rb
+++ b/test/net/smtp/test_smtp.rb
@@ -1,9 +1,9 @@
require 'net/smtp'
require 'stringio'
-require 'minitest/autorun'
+require 'test/unit'
module Net
- class TestSMTP < MiniTest::Unit::TestCase
+ class TestSMTP < Test::Unit::TestCase
class FakeSocket
def initialize out = "250 OK\n"
@write_io = StringIO.new
@@ -24,7 +24,7 @@ module Net
def test_critical
smtp = Net::SMTP.new 'localhost', 25
- assert_raises RuntimeError do
+ assert_raise RuntimeError do
smtp.send :critical do
raise 'fail on purpose'
end
diff --git a/test/net/smtp/test_ssl_socket.rb b/test/net/smtp/test_ssl_socket.rb
index dc8b03e..ff229b5 100644
--- a/test/net/smtp/test_ssl_socket.rb
+++ b/test/net/smtp/test_ssl_socket.rb
@@ -1,8 +1,8 @@
require 'net/smtp'
-require 'minitest/autorun'
+require 'test/unit'
module Net
- class TestSSLSocket < MiniTest::Unit::TestCase
+ class TestSSLSocket < Test::Unit::TestCase
class MySMTP < SMTP
attr_accessor :fake_tcp, :fake_ssl
@@ -52,7 +52,7 @@ module Net
connection.fake_tcp = tcp_socket
connection.fake_ssl = ssl_socket
- assert_raises(OpenSSL::SSL::SSLError) do
+ assert_raise(OpenSSL::SSL::SSLError) do
connection.start
end
assert_equal true, ssl_socket.closed
diff --git a/test/open-uri/test_open-uri.rb b/test/open-uri/test_open-uri.rb
index 3545f5d..e472257 100644
--- a/test/open-uri/test_open-uri.rb
+++ b/test/open-uri/test_open-uri.rb
@@ -137,7 +137,7 @@ class TestOpenURI < Test::Unit::TestCase
end
def test_open_timeout
- assert_raises(Net::OpenTimeout) do
+ assert_raise(Net::OpenTimeout) do
URI("http://example.com/").read(open_timeout: 0.000001)
end if false # avoid external resources in tests
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb
index 9fb5a55..8955d72 100644
--- a/test/openssl/test_asn1.rb
+++ b/test/openssl/test_asn1.rb
@@ -552,7 +552,7 @@ rEzBQ0F9dUyqQ9gyRg8KHhDfv9HzT1d/rnUZMkoombwYBRIUChGCYV0GnJcan2Zm
end
def test_primitive_inf_length
- assert_raises(OpenSSL::ASN1::ASN1Error) do
+ assert_raise(OpenSSL::ASN1::ASN1Error) do
spec = %w{ 02 80 02 01 01 00 00 }
raw = [spec.join('')].pack('H*')
OpenSSL::ASN1.decode(raw)
diff --git a/test/openssl/test_buffering.rb b/test/openssl/test_buffering.rb
index c62dd4d..0ca6459 100644
--- a/test/openssl/test_buffering.rb
+++ b/test/openssl/test_buffering.rb
@@ -61,7 +61,7 @@ class OpenSSL::TestBuffering < Test::Unit::TestCase
raise SystemCallError, 'fail'
end
- assert_raises SystemCallError do
+ assert_raise SystemCallError do
@io.flush
end
diff --git a/test/openssl/test_digest.rb b/test/openssl/test_digest.rb
index a23b2ef..5390225 100644
--- a/test/openssl/test_digest.rb
+++ b/test/openssl/test_digest.rb
@@ -106,7 +106,7 @@ class OpenSSL::TestDigest < Test::Unit::TestCase
def test_openssl_digest
assert_equal OpenSSL::Digest::MD5, OpenSSL::Digest("MD5")
- assert_raises NameError do
+ assert_raise NameError do
OpenSSL::Digest("no such digest")
end
end
diff --git a/test/openssl/test_pkcs12.rb b/test/openssl/test_pkcs12.rb
index 4e37904..c44cee0 100644
--- a/test/openssl/test_pkcs12.rb
+++ b/test/openssl/test_pkcs12.rb
@@ -113,7 +113,7 @@ Li8JsX5yIiuVYaBg/6ha3tOg4TCa5K/3r3tVliRZ2Es=
end
def test_create_with_bad_nid
- assert_raises(ArgumentError) do
+ assert_raise(ArgumentError) do
OpenSSL::PKCS12.create(
"omg",
"hello",
@@ -137,7 +137,7 @@ Li8JsX5yIiuVYaBg/6ha3tOg4TCa5K/3r3tVliRZ2Es=
2048
)
- assert_raises(TypeError) do
+ assert_raise(TypeError) do
OpenSSL::PKCS12.create(
"omg",
"hello",
@@ -164,7 +164,7 @@ Li8JsX5yIiuVYaBg/6ha3tOg4TCa5K/3r3tVliRZ2Es=
2048
)
- assert_raises(TypeError) do
+ assert_raise(TypeError) do
OpenSSL::PKCS12.create(
"omg",
"hello",
diff --git a/test/openssl/test_pkey_dh.rb b/test/openssl/test_pkey_dh.rb
index 67dd3e7..8bf9816 100644
--- a/test/openssl/test_pkey_dh.rb
+++ b/test/openssl/test_pkey_dh.rb
@@ -13,7 +13,7 @@ class OpenSSL::TestPKeyDH < Test::Unit::TestCase
def test_new_break
assert_nil(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
- assert_raises(RuntimeError) do
+ assert_raise(RuntimeError) do
OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise }
end
end
diff --git a/test/optparse/test_acceptable.rb b/test/optparse/test_acceptable.rb
index 6ec619e..ee8479c 100644
--- a/test/optparse/test_acceptable.rb
+++ b/test/optparse/test_acceptable.rb
@@ -32,19 +32,19 @@ class TestOptionParser::Acceptable < TestOptionParser
assert_equal(%w"", no_error {@opt.parse!(%w"--integer 0x3")})
assert_equal(3, @integer)
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--integer 0b")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--integer 09")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--integer 0x")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--integer 1234xyz")
end
end
@@ -65,11 +65,11 @@ class TestOptionParser::Acceptable < TestOptionParser
assert_equal(%w"", no_error {@opt.parse!(%w"--float 1E-2")})
assert_in_epsilon(0.01, @float)
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--float 0e")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--float 1.234xyz")
end
end
@@ -87,15 +87,15 @@ class TestOptionParser::Acceptable < TestOptionParser
assert_equal(%w"", no_error {@opt.parse!(%w"--numeric 1.2/2.3")})
assert_equal(Rational(12, 23), @numeric)
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--numeric 1/")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--numeric 12/34xyz")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--numeric 12x/34yz")
end
end
@@ -107,21 +107,21 @@ class TestOptionParser::Acceptable < TestOptionParser
assert_equal(%w"", no_error {@opt.parse!(%w"--decimal-integer 10")})
assert_equal(10, @decimal_integer)
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--decimal-integer 0b1")
end
- e = assert_raises(OptionParser::InvalidArgument) do
+ e = assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--decimal-integer 09")
end
assert_equal("invalid argument: --decimal-integer 09", e.message)
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--decimal-integer x")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--decimal-integer 1234xyz")
end
end
@@ -142,19 +142,19 @@ class TestOptionParser::Acceptable < TestOptionParser
assert_equal(%w"", no_error {@opt.parse!(%w"--octal-integer 011")})
assert_equal(9, @octal_integer)
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--octal-integer 09")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--octal-integer 0b1")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--octal-integer x")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--octal-integer 01234xyz")
end
end
@@ -172,21 +172,21 @@ class TestOptionParser::Acceptable < TestOptionParser
assert_equal(%w"", no_error {@opt.parse!(%w"--decimal-numeric 1E2")})
assert_in_delta(100.0, @decimal_numeric)
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--decimal-numeric 0b1")
end
- e = assert_raises(OptionParser::InvalidArgument) do
+ e = assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--decimal-numeric 09")
end
assert_equal("invalid argument: --decimal-numeric 09", e.message)
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--decimal-integer 1234xyz")
end
- assert_raises(OptionParser::InvalidArgument) do
+ assert_raise(OptionParser::InvalidArgument) do
@opt.parse!(%w"--decimal-integer 12.34xyz")
end
end
diff --git a/test/rexml/test_changing_encoding.rb b/test/rexml/test_changing_encoding.rb
index 5a085e2..9471ad1 100644
--- a/test/rexml/test_changing_encoding.rb
+++ b/test/rexml/test_changing_encoding.rb
@@ -21,7 +21,7 @@ module REXMLTests
@f.encoding = 'EUC-JP'
assert_equal( @u, @f.decode(@e) )
# This doesn't happen anymore, for some reason
- #assert_raises( Iconv::IllegalSequence, "Decoding unicode should fail" ) {
+ #assert_raise( Iconv::IllegalSequence, "Decoding unicode should fail" ) {
# @f.decode(@u) == @u
#}
end
@@ -36,7 +36,7 @@ module REXMLTests
@f.encoding = 'EUC-JP'
assert_equal( @u, @f.decode(@e) )
# This doesn't happen anymore, for some reason
- #assert_raises( Iconv::IllegalSequence, "Decoding unicode should fail" ) {
+ #assert_raise( Iconv::IllegalSequence, "Decoding unicode should fail" ) {
# @f.decode(@u) == @u
#}
end
diff --git a/test/rexml/test_entity.rb b/test/rexml/test_entity.rb
index 7d16dc8..bef1bd6 100644
--- a/test/rexml/test_entity.rb
+++ b/test/rexml/test_entity.rb
@@ -118,7 +118,7 @@ module REXMLTests
# above 10k explodes
entities = '&a;' * 3 # 5k entity * 2 = 15k
xmldoc = REXML::Document.new(template.sub(/\$/, entities))
- assert_raises(RuntimeError) do
+ assert_raise(RuntimeError) do
xmldoc.root.text
end
end
@@ -134,7 +134,7 @@ module REXMLTests
# above 10k explodes
entities = '%a;' * 3 # 5k entity * 2 = 15k
- assert_raises(REXML::ParseException) do
+ assert_raise(REXML::ParseException) do
REXML::Document.new(template.sub(/\$/, entities))
end
end
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 56b6306..d0a4826 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -147,7 +147,7 @@ class TestGc < Test::Unit::TestCase
assert_not_empty info
assert_equal info[:gc_by], GC.latest_gc_info(:gc_by)
- assert_raises(ArgumentError){ GC.latest_gc_info(:invalid) }
+ assert_raise(ArgumentError){ GC.latest_gc_info(:invalid) }
assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) {GC.latest_gc_info(:"\u{30eb 30d3 30fc}")}
end
diff --git a/test/socket/test_nonblock.rb b/test/socket/test_nonblock.rb
index 8086c38..d058add 100644
--- a/test/socket/test_nonblock.rb
+++ b/test/socket/test_nonblock.rb
@@ -279,7 +279,7 @@ class TestSocketNonblock < Test::Unit::TestCase
def test_sendmsg_nonblock_seqpacket
buf = '*' * 10000
UNIXSocket.pair(:SEQPACKET) do |s1, s2|
- assert_raises(IO::WaitWritable) do
+ assert_raise(IO::WaitWritable) do
loop { s1.sendmsg_nonblock(buf) }
end
end
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 1db0ea2..3682338 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -78,7 +78,7 @@ class TestSocket < Test::Unit::TestCase
port, = Socket.unpack_sockaddr_in(addr)
Socket.open(Socket::AF_INET, Socket::SOCK_STREAM, 0) {|s|
- e = assert_raises(Errno::EADDRINUSE) do
+ e = assert_raise(Errno::EADDRINUSE) do
s.bind(Socket.sockaddr_in(port, "127.0.0.1"))
end
@@ -556,7 +556,7 @@ class TestSocket < Test::Unit::TestCase
# some platforms may not timeout when the listener queue overflows,
# but we know Linux does with the default listen backlog of SOMAXCONN for
# TCPServer.
- assert_raises(Errno::ETIMEDOUT) do
+ assert_raise(Errno::ETIMEDOUT) do
(Socket::SOMAXCONN*2).times do |i|
sock = Socket.tcp(host, port, :connect_timeout => 0)
assert_equal sock, IO.select(nil, [ sock ])[1][0],
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb
index a6c332c..5e3528e 100644
--- a/test/socket/test_tcp.rb
+++ b/test/socket/test_tcp.rb
@@ -79,9 +79,9 @@ class TestSocket_TCPSocket < Test::Unit::TestCase
def test_accept_nonblock
TCPServer.open("localhost", 0) {|svr|
- assert_raises(IO::WaitReadable) { svr.accept_nonblock }
+ assert_raise(IO::WaitReadable) { svr.accept_nonblock }
assert_equal :wait_readable, svr.accept_nonblock(exception: false)
- assert_raises(IO::WaitReadable) { svr.accept_nonblock(exception: true) }
+ assert_raise(IO::WaitReadable) { svr.accept_nonblock(exception: true) }
}
end
end if defined?(TCPSocket)
diff --git a/test/socket/test_udp.rb b/test/socket/test_udp.rb
index b07a4b7..7d28ec2 100644
--- a/test/socket/test_udp.rb
+++ b/test/socket/test_udp.rb
@@ -48,7 +48,7 @@ class TestSocket_UDPSocket < Test::Unit::TestCase
s = UDPSocket.new
- e = assert_raises(Errno::EADDRINUSE) do
+ e = assert_raise(Errno::EADDRINUSE) do
s.bind(host, port)
end
@@ -61,7 +61,7 @@ class TestSocket_UDPSocket < Test::Unit::TestCase
def test_send_too_long
u = UDPSocket.new
- e = assert_raises Errno::EMSGSIZE do
+ e = assert_raise(Errno::EMSGSIZE) do
u.send "\0" * 100_000, 0, "127.0.0.1", 7 # echo
end
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index 829eaa9..a10f2e5 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -665,8 +665,8 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
def test_accept_nonblock
bound_unix_socket(UNIXServer) {|serv, path|
- assert_raises(IO::WaitReadable) { serv.accept_nonblock }
- assert_raises(IO::WaitReadable) { serv.accept_nonblock(exception: true) }
+ assert_raise(IO::WaitReadable) { serv.accept_nonblock }
+ assert_raise(IO::WaitReadable) { serv.accept_nonblock(exception: true) }
assert_equal :wait_readable, serv.accept_nonblock(exception: false)
}
end
diff --git a/test/test_ipaddr.rb b/test/test_ipaddr.rb
index 5c52247..ccf1473 100644
--- a/test/test_ipaddr.rb
+++ b/test/test_ipaddr.rb
@@ -69,15 +69,15 @@ class TC_IPAddr < Test::Unit::TestCase
assert_equal("1:2:3:4:5:6:7:0", IPAddr.new("1:2:3:4:5:6:7::").to_s)
assert_equal("0:2:3:4:5:6:7:8", IPAddr.new("::2:3:4:5:6:7:8").to_s)
- assert_raises(IPAddr::InvalidAddressError) { IPAddr.new("192.168.0.256") }
- assert_raises(IPAddr::InvalidAddressError) { IPAddr.new("192.168.0.011") }
- assert_raises(IPAddr::InvalidAddressError) { IPAddr.new("fe80::1%fxp0") }
- assert_raises(IPAddr::InvalidAddressError) { IPAddr.new("[192.168.1.2]/120") }
- assert_raises(IPAddr::InvalidPrefixError) { IPAddr.new("::1/255.255.255.0") }
- assert_raises(IPAddr::InvalidPrefixError) { IPAddr.new("::1/129") }
- assert_raises(IPAddr::InvalidPrefixError) { IPAddr.new("192.168.0.1/33") }
- assert_raises(IPAddr::AddressFamilyError) { IPAddr.new(1) }
- assert_raises(IPAddr::AddressFamilyError) { IPAddr.new("::ffff:192.168.1.2/120", Socket::AF_INET) }
+ assert_raise(IPAddr::InvalidAddressError) { IPAddr.new("192.168.0.256") }
+ assert_raise(IPAddr::InvalidAddressError) { IPAddr.new("192.168.0.011") }
+ assert_raise(IPAddr::InvalidAddressError) { IPAddr.new("fe80::1%fxp0") }
+ assert_raise(IPAddr::InvalidAddressError) { IPAddr.new("[192.168.1.2]/120") }
+ assert_raise(IPAddr::InvalidPrefixError) { IPAddr.new("::1/255.255.255.0") }
+ assert_raise(IPAddr::InvalidPrefixError) { IPAddr.new("::1/129") }
+ assert_raise(IPAddr::InvalidPrefixError) { IPAddr.new("192.168.0.1/33") }
+ assert_raise(IPAddr::AddressFamilyError) { IPAddr.new(1) }
+ assert_raise(IPAddr::AddressFamilyError) { IPAddr.new("::ffff:192.168.1.2/120", Socket::AF_INET) }
end
def test_s_new_ntoh
@@ -138,14 +138,14 @@ class TC_IPAddr < Test::Unit::TestCase
def test_ip6_arpa
assert_equal("f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.arpa", IPAddr.new("3ffe:505:2::f").ip6_arpa)
- assert_raises(IPAddr::InvalidAddressError) {
+ assert_raise(IPAddr::InvalidAddressError) {
IPAddr.new("192.168.2.1").ip6_arpa
}
end
def test_ip6_int
assert_equal("f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.int", IPAddr.new("3ffe:505:2::f").ip6_int)
- assert_raises(IPAddr::InvalidAddressError) {
+ assert_raise(IPAddr::InvalidAddressError) {
IPAddr.new("192.168.2.1").ip6_int
}
end
diff --git a/test/test_prime.rb b/test/test_prime.rb
index 48322a5..cdb6f89 100644
--- a/test/test_prime.rb
+++ b/test/test_prime.rb
@@ -64,7 +64,7 @@ class TestPrime < Test::Unit::TestCase
end
def test_new
- exception = assert_raises(NoMethodError) { Prime.new }
+ exception = assert_raise(NoMethodError) { Prime.new }
end
def test_enumerator_succ
diff --git a/test/test_set.rb b/test/test_set.rb
index 961578b..e9867dd 100644
--- a/test/test_set.rb
+++ b/test/test_set.rb
@@ -26,13 +26,13 @@ class TC_Set < Test::Unit::TestCase
Set.new([1,2])
Set.new('a'..'c')
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
Set.new(false)
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
Set.new(1)
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
Set.new(1,2)
}
@@ -157,7 +157,7 @@ class TC_Set < Test::Unit::TestCase
set1 = Set[1, set2]
set2.add(set1)
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set1.flatten!
}
@@ -199,15 +199,15 @@ class TC_Set < Test::Unit::TestCase
def test_superset?
set = Set[1,2,3]
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.superset?()
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.superset?(2)
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.superset?([2])
}
@@ -226,15 +226,15 @@ class TC_Set < Test::Unit::TestCase
def test_proper_superset?
set = Set[1,2,3]
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.proper_superset?()
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.proper_superset?(2)
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.proper_superset?([2])
}
@@ -253,15 +253,15 @@ class TC_Set < Test::Unit::TestCase
def test_subset?
set = Set[1,2,3]
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.subset?()
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.subset?(2)
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.subset?([2])
}
@@ -280,15 +280,15 @@ class TC_Set < Test::Unit::TestCase
def test_proper_subset?
set = Set[1,2,3]
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.proper_subset?()
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.proper_subset?(2)
}
- assert_raises(ArgumentError) {
+ assert_raise(ArgumentError) {
set.proper_subset?([2])
}
@@ -316,10 +316,10 @@ class TC_Set < Test::Unit::TestCase
assert_send([set, :disjoint?, other])
assert_send([other, :disjoint?, set])
when Class
- assert_raises(expected) {
+ assert_raise(expected) {
set.intersect?(other)
}
- assert_raises(expected) {
+ assert_raise(expected) {
set.disjoint?(other)
}
else
@@ -585,7 +585,7 @@ class TC_Set < Test::Unit::TestCase
set << 4
assert_same orig, set.freeze
assert_equal true, set.frozen?
- assert_raises(RuntimeError) {
+ assert_raise(RuntimeError) {
set << 5
}
assert_equal 4, set.size
diff --git a/test/test_singleton.rb b/test/test_singleton.rb
index 259f9c5..36d4937 100644
--- a/test/test_singleton.rb
+++ b/test/test_singleton.rb
@@ -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
diff --git a/test/test_syslog.rb b/test/test_syslog.rb
index 3164d07..7f1f76f 100644
--- a/test/test_syslog.rb
+++ b/test/test_syslog.rb
@@ -11,7 +11,7 @@ end
class TestSyslog < Test::Unit::TestCase
def test_new
- assert_raises(NoMethodError) {
+ assert_raise(NoMethodError) {
Syslog.new
}
end
@@ -37,7 +37,7 @@ class TestSyslog < Test::Unit::TestCase
assert_equal(Syslog::LOG_USER, Syslog.facility)
# open without close
- assert_raises(RuntimeError) {
+ assert_raise(RuntimeError) {
Syslog.open
}
@@ -88,7 +88,7 @@ class TestSyslog < Test::Unit::TestCase
end
def test_close
- assert_raises(RuntimeError) {
+ assert_raise(RuntimeError) {
Syslog.close
}
end
diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb
index ea237c6..37b1dd5 100644
--- a/test/webrick/test_server.rb
+++ b/test/webrick/test_server.rb
@@ -29,7 +29,7 @@ class TestWEBrickServer < Test::Unit::TestCase
log = []
logger = WEBrick::Log.new(log, WEBrick::BasicLog::WARN)
- assert_raises(SignalException) do
+ assert_raise(SignalException) do
listener = Object.new
def listener.to_io # IO.select invokes #to_io.
raise SignalException, 'SIGTERM' # simulate signal in main thread
diff --git a/test/xmlrpc/test_client.rb b/test/xmlrpc/test_client.rb
index 83f8c6b..b189728 100644
--- a/test/xmlrpc/test_client.rb
+++ b/test/xmlrpc/test_client.rb
@@ -1,4 +1,4 @@
-require 'minitest/autorun'
+require 'test/unit'
require 'xmlrpc/client'
require 'net/http'
begin
@@ -7,7 +7,7 @@ rescue LoadError
end
module XMLRPC
- class ClientTest < MiniTest::Unit::TestCase
+ class ClientTest < Test::Unit::TestCase
module Fake
class HTTP
attr_accessor :read_timeout, :open_timeout, :use_ssl
@@ -182,13 +182,13 @@ module XMLRPC
end
def test_new2_bad_protocol
- assert_raises(ArgumentError) do
+ assert_raise(ArgumentError) do
XMLRPC::Client.new2 'ftp://example.org'
end
end
def test_new2_bad_uri
- assert_raises(ArgumentError) do
+ assert_raise(ArgumentError) do
XMLRPC::Client.new2 ':::::'
end
end
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb
index f52c7e0..b22e04e 100644
--- a/test/zlib/test_zlib.rb
+++ b/test/zlib/test_zlib.rb
@@ -233,7 +233,7 @@ if defined? Zlib
class TestZlibInflate < Test::Unit::TestCase
def test_class_inflate_dictionary
- assert_raises(Zlib::NeedDict) do
+ assert_raise(Zlib::NeedDict) do
Zlib::Inflate.inflate([0x08,0x3C,0x0,0x0,0x0,0x0].pack("c*"))
end
end