summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Widmer <m-widmer@gmx.ch>2016-04-18 13:31:45 +0200
committerManuel Widmer <m-widmer@gmx.ch>2016-04-18 13:31:45 +0200
commitb0840bbafddb47b11647932c3db3578301adf8f6 (patch)
tree4070866d7c8e3ffa727f8ddaf012cca4d6bf757f
parent54a8373895a16a099cd451feda82f580af86b9cb (diff)
downloadipaddress-b0840bbafddb47b11647932c3db3578301adf8f6.tar.gz
update unit-tests changed ArgumentError to RuntimeError
-rw-r--r--test/ipaddress/ipv4_test.rb10
-rw-r--r--test/ipaddress/ipv6_test.rb6
2 files changed, 8 insertions, 8 deletions
diff --git a/test/ipaddress/ipv4_test.rb b/test/ipaddress/ipv4_test.rb
index b8152f0..8743121 100644
--- a/test/ipaddress/ipv4_test.rb
+++ b/test/ipaddress/ipv4_test.rb
@@ -472,12 +472,12 @@ class IPv4Test < Minitest::Test
assert_equal ip.add(IPAddress::IPv4.new("0.0.0.5/6")), IPAddress::IPv4.new("172.16.10.6/24")
assert_equal ip.add(50), IPAddress::IPv4.new("172.16.10.51/24")
assert_equal ip.add(254), IPAddress::IPv4.new("172.16.10.255/24")
- assert_raise(ArgumentError) {ip.add(255)}
+ assert_raise(RuntimeError) {ip.add(255)}
assert_equal ip.add(255, false), IPAddress::IPv4.new("172.16.11.0/24")
- assert_raise(ArgumentError) {ip.add(1000)}
+ assert_raise(RuntimeError) {ip.add(1000)}
ip = IPAddress::IPv4.new("172.16.10.1/30")
assert_equal ip.add(2), IPAddress::IPv4.new("172.16.10.3/30")
- assert_raise(ArgumentError) {ip.add(3)}
+ assert_raise(RuntimeError) {ip.add(3)}
end
def test_method_subtract
@@ -485,9 +485,9 @@ class IPv4Test < Minitest::Test
assert_equal ip.subtract(5), IPAddress::IPv4.new("172.16.10.5/24")
assert_equal ip.subtract(IPAddress::IPv4.new("0.0.0.5/32")), IPAddress::IPv4.new("172.16.10.5/24")
assert_equal ip.subtract(10), IPAddress::IPv4.new("172.16.10.0/24")
- assert_raise(ArgumentError) {ip.subtract(11)}
+ assert_raise(RuntimeError) {ip.subtract(11)}
assert_equal ip.subtract(11, false), IPAddress::IPv4.new("172.16.9.255/24")
- assert_raise(ArgumentError) {ip.subtract(IPAddress::IPv4.new("0.0.0.11/16"))}
+ assert_raise(RuntimeError) {ip.subtract(IPAddress::IPv4.new("0.0.0.11/16"))}
end
def test_method_hostpart
diff --git a/test/ipaddress/ipv6_test.rb b/test/ipaddress/ipv6_test.rb
index fdfcbea..c4adb96 100644
--- a/test/ipaddress/ipv6_test.rb
+++ b/test/ipaddress/ipv6_test.rb
@@ -263,7 +263,7 @@ class IPv6Test < Minitest::Test
assert_equal ip.add(50), IPAddress::IPv6.new("fc42:1337::32/64")
ip = IPAddress::IPv6.new("fc42:1337::/120")
assert_equal ip.add(2), IPAddress::IPv6.new("fc42:1337::2/120")
- assert_raise(ArgumentError) {ip.add(256)}
+ assert_raise(RuntimeError) {ip.add(256)}
assert_equal ip.add(256, false), IPAddress::IPv6.new("fc42:1337::100/120")
end
@@ -271,8 +271,8 @@ class IPv6Test < Minitest::Test
ip = IPAddress::IPv6.new("fc42:1337::5/64")
assert_equal ip.subtract(5), IPAddress::IPv6.new("fc42:1337::/64")
assert_equal ip.subtract(IPAddress::IPv6.new("::5/12")), IPAddress::IPv6.new("fc42:1337::0/64")
- assert_raise(ArgumentError) {ip.subtract(11)}
- assert_raise(ArgumentError) {ip.subtract(IPAddress::IPv6.new("::11/66"))}
+ assert_raise(RuntimeError) {ip.subtract(11)}
+ assert_raise(RuntimeError) {ip.subtract(IPAddress::IPv6.new("::11/66"))}
end
def test_method_hostpart