summaryrefslogtreecommitdiff
path: root/test/test_ipaddr.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_ipaddr.rb')
-rw-r--r--test/test_ipaddr.rb22
1 files changed, 11 insertions, 11 deletions
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