summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Rodrigues <mikebrodrigues@gmail.com>2014-01-01 23:25:50 -0800
committerMichael Rodrigues <mikebrodrigues@gmail.com>2014-01-01 23:25:50 -0800
commitc2704ae93df103bbd14a2daddd8a3fe5b2f9cf4b (patch)
tree10469d5a2b24320584181b8ce202a14d25e2854b /test
parente781b98d3c8dc8c118fd496095443dd839e2cd92 (diff)
downloadipaddress-c2704ae93df103bbd14a2daddd8a3fe5b2f9cf4b.tar.gz
added tests for /32
Diffstat (limited to 'test')
-rw-r--r--test/ipaddress/ipv4_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ipaddress/ipv4_test.rb b/test/ipaddress/ipv4_test.rb
index f144634..38cac74 100644
--- a/test/ipaddress/ipv4_test.rb
+++ b/test/ipaddress/ipv4_test.rb
@@ -127,6 +127,7 @@ class IPv4Test < Test::Unit::TestCase
@valid_ipv4.each do |arg,attr|
ip = @klass.new(arg)
assert_equal attr.first, ip.to_s
+
end
end
@@ -177,6 +178,9 @@ class IPv4Test < Test::Unit::TestCase
ip = @klass.new("192.168.100.50/24")
assert_instance_of @klass, ip.first
assert_equal "192.168.100.1", ip.first.to_s
+ ip = @klass.new("192.168.100.50/32")
+ assert_instance_of @klass, ip.first
+ assert_equal "192.168.100.50", ip.first.to_s
end
def test_method_last
@@ -186,6 +190,9 @@ class IPv4Test < Test::Unit::TestCase
ip = @klass.new("192.168.100.50/24")
assert_instance_of @klass, ip.last
assert_equal "192.168.100.254", ip.last.to_s
+ ip = @klass.new("192.168.100.50/32")
+ assert_instance_of @klass, ip.last
+ assert_equal "192.168.100.50", ip.last.to_s
end
def test_method_each_host