test/answer/parser/whois.nic.hu_test.rb in whois-1.0.12 vs test/answer/parser/whois.nic.hu_test.rb in whois-1.1.0

- old
+ new

@@ -111,33 +111,33 @@ assert_equal nil, @klass.new(load_part('/in_progress.txt')).registrar end - def test_registrant_with_registered - parser = @klass.new(load_part('/registered.txt')) - result = parser.registrant - assert_instance_of Whois::Answer::Contact, result - assert_equal result, parser.registrant - assert_equal result, parser.instance_eval { @registrant } + def test_registrant_contact_with_registered + parser = @klass.new(load_part('/registered.txt')) + expected = parser.registrant_contact + assert_instance_of Whois::Answer::Contact, expected + assert_equal expected, parser.registrant_contact + assert_equal expected, parser.instance_eval { @registrant_contact } end - def test_registrant_with_unregistered - parser = @klass.new(load_part('/available.txt')) - result = nil - assert_equal result, parser.registrant - assert_equal result, parser.instance_eval { @registrant } + def test_registrant_contact_with_unregistered + parser = @klass.new(load_part('/available.txt')) + expected = nil + assert_equal expected, parser.registrant_contact + assert_equal expected, parser.instance_eval { @registrant_contact } - parser = @klass.new(load_part('/in_progress.txt')) - result = nil - assert_equal result, parser.registrant - assert_equal result, parser.instance_eval { @registrant } + parser = @klass.new(load_part('/in_progress.txt')) + expected = nil + assert_equal expected, parser.registrant_contact + assert_equal expected, parser.instance_eval { @registrant } end - def test_registrant_as_company + def test_registrant_contact_as_company parser = @klass.new(load_part('/property_registrant_as_company.txt')) - result = parser.registrant + result = parser.registrant_contact assert_instance_of Whois::Answer::Contact, result assert_equal 'Google, Inc.', result.name assert_equal 'Google, Inc.', result.organization assert_equal 'Amphitheatre Pkwy 1600.', result.address @@ -146,13 +146,13 @@ assert_equal 'US', result.country_code assert_equal '+1 650 253 0000', result.phone assert_equal '+1 650 253 0001', result.fax end - def test_registrant_as_private_person + def test_registrant_contact_as_private_person parser = @klass.new(load_part('/property_registrant_as_private_person.txt')) - result = parser.registrant + result = parser.registrant_contact assert_instance_of Whois::Answer::Contact, result assert_match /Buruzs/, result.name # UTF-8 hack assert_equal nil, result.organization assert_equal nil, result.address @@ -161,22 +161,22 @@ assert_equal nil, result.country_code assert_equal nil, result.phone assert_equal nil, result.fax end - def test_registrant_without_address + def test_registrant_contact_without_address parser = @klass.new(load_part('/property_registrant_without_address.txt')) - result = parser.registrant + result = parser.registrant_contact assert_equal nil, result.address assert_equal nil, result.zip assert_equal nil, result.city assert_equal nil, result.country_code end - def test_admin_with_registered - admin = @klass.new(load_part('/registered.txt')).admin + def test_admin_contact_with_registered + admin = @klass.new(load_part('/registered.txt')).admin_contact assert_instance_of Whois::Answer::Contact, admin assert_equal '2000466366', admin.id assert_equal '3C Kft. (Registrar)', admin.name assert_equal 'Konkoly Thege Ășt 29-33.', admin.address assert_equal 'H-1121', admin.zip @@ -184,19 +184,24 @@ assert_equal 'HU', admin.country_code assert_equal '+36 1 275 52 00', admin.phone assert_equal '+36 1 275 58 87', admin.fax end - def test_admin_with_unregistered - assert_equal nil, - @klass.new(load_part('/available.txt')).admin - assert_equal nil, - @klass.new(load_part('/in_progress.txt')).admin + def test_admin_contact_with_unregistered + parser = @klass.new(load_part('/available.txt')) + expected = nil + assert_equal expected, parser.admin_contact + assert_equal expected, parser.instance_eval { @admin_contact } + + parser = @klass.new(load_part('/in_progress.txt')) + expected = nil + assert_equal expected, parser.admin_contact + assert_equal expected, parser.instance_eval { @admin_contact } end - def test_technical_with_registered - technical = @klass.new(load_part('/registered.txt')).technical + def test_technical_contact_with_registered + technical = @klass.new(load_part('/registered.txt')).technical_contact assert_instance_of Whois::Answer::Contact, technical assert_equal '2000578125', technical.id assert_equal 'Markmonitor', technical.name assert_equal 'Overland Road 10400, PMB155', technical.address assert_equal 'ID-83709', technical.zip @@ -205,14 +210,19 @@ assert_equal '+ 1 208 389 5798', technical.phone assert_equal '+ 1 208 389 5771', technical.fax assert_equal 'ccops@markmonitor.com', technical.email end - def test_technical_with_unregistered - assert_equal nil, - @klass.new(load_part('/available.txt')).technical - assert_equal nil, - @klass.new(load_part('/in_progress.txt')).technical + def test_technical_contact_with_unregistered + parser = @klass.new(load_part('/available.txt')) + expected = nil + assert_equal expected, parser.technical_contact + assert_equal expected, parser.instance_eval { @technical_contact } + + parser = @klass.new(load_part('/in_progress.txt')) + expected = nil + assert_equal expected, parser.technical_contact + assert_equal expected, parser.instance_eval { @technical_contact } end def test_nameserver parser = @klass.new(load_part('/registered.txt')) \ No newline at end of file