diff options
author | Dan Seaver <git@danseaver.com> | 2012-05-07 09:25:36 -0400 |
---|---|---|
committer | Dan Seaver <git@danseaver.com> | 2012-05-07 09:25:36 -0400 |
commit | c334175f0a83303c70cc272f7965284c79698dec (patch) | |
tree | cfb95093dfcb20df4cd3a1ce17fa0c3a04654bad /activerecord/test/cases | |
parent | f7b8fbd4b12e07d94b2fbd23b07e8dd9c3f0e702 (diff) | |
download | rails-c334175f0a83303c70cc272f7965284c79698dec.tar.gz rails-c334175f0a83303c70cc272f7965284c79698dec.tar.bz2 rails-c334175f0a83303c70cc272f7965284c79698dec.zip |
Converts inet and cidr columns to NetAddr::CIDR
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/datatype_test.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/datatype_test.rb b/activerecord/test/cases/adapters/postgresql/datatype_test.rb index d42f1ff5a1..cf58c3089f 100644 --- a/activerecord/test/cases/adapters/postgresql/datatype_test.rb +++ b/activerecord/test/cases/adapters/postgresql/datatype_test.rb @@ -135,8 +135,10 @@ class PostgresqlDataTypeTest < ActiveRecord::TestCase end def test_network_address_values - assert_equal '192.168.0.0/24', @first_network_address.cidr_address - assert_equal '172.16.1.254', @first_network_address.inet_address + cidr_address = NetAddr::CIDR.create '192.168.0.0/24' + inet_address = NetAddr::CIDR.create '172.16.1.254' + assert_equal cidr_address, @first_network_address.cidr_address + assert_equal inet_address, @first_network_address.inet_address assert_equal '01:23:45:67:89:0a', @first_network_address.mac_address end @@ -200,8 +202,8 @@ class PostgresqlDataTypeTest < ActiveRecord::TestCase end def test_update_network_address - new_cidr_address = '10.1.2.3/32' - new_inet_address = '10.0.0.0/8' + new_inet_address = '10.1.2.3/32' + new_cidr_address = '10.0.0.0/8' new_mac_address = 'bc:de:f0:12:34:56' assert @first_network_address.cidr_address = new_cidr_address assert @first_network_address.inet_address = new_inet_address |