From c87a7c1492232dfacd7d095d5393b259ad7dbed1 Mon Sep 17 00:00:00 2001 From: Simone Carletti Date: Tue, 26 Jun 2012 15:08:54 +0200 Subject: [PATCH] whois.registrypro.pro is now a full parser. Based on BaseAfilias. See https://github.com/weppos/ianawhois/commit/a21b22702b242c67e417f534f3b8eaa8110cfa46 --- CHANGELOG.md | 2 + lib/whois/record/parser/whois.aero.rb | 4 + .../record/parser/whois.registrypro.pro.rb | 47 +--------- .../whois.aero/status_registered.expected | 72 +++++++-------- .../status_available.expected | 34 +++++++ .../status_registered.expected | 76 ++++++++++++++++ .../whois.aero/status_registered_spec.rb | 72 +++++++-------- .../status_available_spec.rb | 48 ++++++++++ .../status_registered_spec.rb | 90 +++++++++++++++++++ 9 files changed, 328 insertions(+), 117 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ece19b0fe..4dd119210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +* NEW: whois.registrypro.pro is now a full parser. + * FIXED: In some cases the parser class is not correctly detected from hostname (GH-173). [Thanks @JustinCampbell] * FIXED: whois.ua parser raises ArgumentError when the created_on object invalid data. diff --git a/lib/whois/record/parser/whois.aero.rb b/lib/whois/record/parser/whois.aero.rb index 84a4728a3..ba64b4159 100644 --- a/lib/whois/record/parser/whois.aero.rb +++ b/lib/whois/record/parser/whois.aero.rb @@ -15,6 +15,10 @@ class Record class Parser # Parser for the whois.aero server. + # + # @see Whois::Record::Parser::Example + # The Example parser for the list of all available methods. + # class WhoisAero < BaseAfilias property_supported :status do diff --git a/lib/whois/record/parser/whois.registrypro.pro.rb b/lib/whois/record/parser/whois.registrypro.pro.rb index 0068f8156..d3d311ad3 100644 --- a/lib/whois/record/parser/whois.registrypro.pro.rb +++ b/lib/whois/record/parser/whois.registrypro.pro.rb @@ -7,7 +7,7 @@ #++ -require 'whois/record/parser/base' +require 'whois/record/parser/base_afilias' module Whois @@ -15,54 +15,11 @@ class Record class Parser # Parser for the whois.registrypro.pro server. - # - # @note This parser is just a stub and provides only a few basic methods - # to check for domain availability and get domain status. - # Please consider to contribute implementing missing methods. # # @see Whois::Record::Parser::Example # The Example parser for the list of all available methods. # - class WhoisRegistryproPro < Base - - property_supported :status do - content_for_scanner.scan(/Status:(.+?)\n/).flatten - end - - property_supported :available? do - !!(content_for_scanner.strip == 'NOT FOUND') - end - - property_supported :registered? do - !available? - end - - - property_supported :created_on do - if content_for_scanner =~ /Created On:(.+)\n/ - Time.parse($1) - end - end - - property_supported :updated_on do - if content_for_scanner =~ /Last Updated On:(.+)\n/ - Time.parse($1) - end - end - - property_supported :expires_on do - if content_for_scanner =~ /Expiration Date:(.+)\n/ - Time.parse($1) - end - end - - - property_supported :nameservers do - content_for_scanner.scan(/Name Server:([^\s]+)\n/).flatten.map do |name| - Record::Nameserver.new(:name => name.downcase) - end - end - + class WhoisRegistryproPro < BaseAfilias end end diff --git a/spec/fixtures/responses/whois.aero/status_registered.expected b/spec/fixtures/responses/whois.aero/status_registered.expected index fbede6ad4..b5b8b78eb 100644 --- a/spec/fixtures/responses/whois.aero/status_registered.expected +++ b/spec/fixtures/responses/whois.aero/status_registered.expected @@ -49,52 +49,52 @@ should: %s CLASS(array) should: %s SIZE(1) should: %s[0] CLASS(contact) - should: %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT - should: %s[0].id == "C4526901-AERO" - should: %s[0].name == "Domain Name Administrator" - should: %s[0].organization == "SriLankan Airlines Ltd" - should: %s[0].address == "Admin Bldg" - should: %s[0].city == "Katunayaka" - should: %s[0].zip == "11450" - should: %s[0].state == "WP" - should: %s[0].country_code == "LK" - should: %s[0].phone == "+94.197331600" - should: %s[0].fax == "+94.197335160" - should: %s[0].email == "domregister@srilankan.aero" + should: %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT + should: %s[0].id == "C4526901-AERO" + should: %s[0].name == "Domain Name Administrator" + should: %s[0].organization == "SriLankan Airlines Ltd" + should: %s[0].address == "Admin Bldg" + should: %s[0].city == "Katunayaka" + should: %s[0].zip == "11450" + should: %s[0].state == "WP" + should: %s[0].country_code == "LK" + should: %s[0].phone == "+94.197331600" + should: %s[0].fax == "+94.197335160" + should: %s[0].email == "domregister@srilankan.aero" #admin_contacts should: %s CLASS(array) should: %s SIZE(1) should: %s[0] CLASS(contact) - should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN - should: %s[0].id == "C4526901-AERO" - should: %s[0].name == "Domain Name Administrator" - should: %s[0].organization == "SriLankan Airlines Ltd" - should: %s[0].address == "Admin Bldg" - should: %s[0].city == "Katunayaka" - should: %s[0].zip == "11450" - should: %s[0].state == "WP" - should: %s[0].country_code == "LK" - should: %s[0].phone == "+94.197331600" - should: %s[0].fax == "+94.197335160" - should: %s[0].email == "domregister@srilankan.aero" + should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN + should: %s[0].id == "C4526901-AERO" + should: %s[0].name == "Domain Name Administrator" + should: %s[0].organization == "SriLankan Airlines Ltd" + should: %s[0].address == "Admin Bldg" + should: %s[0].city == "Katunayaka" + should: %s[0].zip == "11450" + should: %s[0].state == "WP" + should: %s[0].country_code == "LK" + should: %s[0].phone == "+94.197331600" + should: %s[0].fax == "+94.197335160" + should: %s[0].email == "domregister@srilankan.aero" #technical_contacts should: %s CLASS(array) should: %s SIZE(1) should: %s[0] CLASS(contact) - should: %s[0].type == Whois::Record::Contact::TYPE_TECHNICAL - should: %s[0].id == "C4526901-AERO" - should: %s[0].name == "Domain Name Administrator" - should: %s[0].organization == "SriLankan Airlines Ltd" - should: %s[0].address == "Admin Bldg" - should: %s[0].city == "Katunayaka" - should: %s[0].zip == "11450" - should: %s[0].state == "WP" - should: %s[0].country_code == "LK" - should: %s[0].phone == "+94.197331600" - should: %s[0].fax == "+94.197335160" - should: %s[0].email == "domregister@srilankan.aero" + should: %s[0].type == Whois::Record::Contact::TYPE_TECHNICAL + should: %s[0].id == "C4526901-AERO" + should: %s[0].name == "Domain Name Administrator" + should: %s[0].organization == "SriLankan Airlines Ltd" + should: %s[0].address == "Admin Bldg" + should: %s[0].city == "Katunayaka" + should: %s[0].zip == "11450" + should: %s[0].state == "WP" + should: %s[0].country_code == "LK" + should: %s[0].phone == "+94.197331600" + should: %s[0].fax == "+94.197335160" + should: %s[0].email == "domregister@srilankan.aero" #nameservers diff --git a/spec/fixtures/responses/whois.registrypro.pro/status_available.expected b/spec/fixtures/responses/whois.registrypro.pro/status_available.expected index bdb73eecc..a42ca4a05 100644 --- a/spec/fixtures/responses/whois.registrypro.pro/status_available.expected +++ b/spec/fixtures/responses/whois.registrypro.pro/status_available.expected @@ -1,3 +1,21 @@ +#disclaimer + should: %s == nil + + +#domain + should: %s == nil + +#domain_id + should: %s == nil + + +#referral_whois + should: %s raise_error(Whois::PropertyNotSupported) + +#referral_url + should: %s raise_error(Whois::PropertyNotSupported) + + #status should: %s == [] @@ -18,6 +36,22 @@ should: %s == nil +#registrar + should: %s == nil + +#registrant_contacts + should: %s CLASS(array) + should: %s == [] + +#admin_contacts + should: %s CLASS(array) + should: %s == [] + +#technical_contacts + should: %s CLASS(array) + should: %s == [] + + #nameservers should: %s CLASS(array) should: %s == [] diff --git a/spec/fixtures/responses/whois.registrypro.pro/status_registered.expected b/spec/fixtures/responses/whois.registrypro.pro/status_registered.expected index 2a5620efd..196f1c783 100644 --- a/spec/fixtures/responses/whois.registrypro.pro/status_registered.expected +++ b/spec/fixtures/responses/whois.registrypro.pro/status_registered.expected @@ -1,3 +1,21 @@ +#disclaimer + should: %s == "Access to .PRO REGISTRY WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the .PRO Registry registry database. The data in this record is provided by .PRO Registry for informational purposes only, and .PRO Registry does not guarantee its accuracy. This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: (a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or Afilias except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. .PRO Registry reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy." + + +#domain + should: %s == "registrypro.pro" + +#domain_id + should: %s == "D6394-PRO" + + +#referral_whois + should: %s raise_error(Whois::PropertyNotSupported) + +#referral_url + should: %s raise_error(Whois::PropertyNotSupported) + + #status should: %s == ["CLIENT TRANSFER PROHIBITED", "DELETE PROHIBITED"] @@ -21,6 +39,64 @@ should: %s == Time.parse("2017-01-26 00:00:00 UTC") +#registrar + should: %s CLASS(registrar) + should: %s.id == "R2338-PRO" + should: %s.name == "Corporation Service Company dba CSC Corporate Domains, Inc" + should: %s.organization == "Corporation Service Company dba CSC Corporate Domains, Inc" + +#registrant_contacts + should: %s CLASS(array) + should: %s SIZE(1) + should: %s[0] CLASS(contact) + should: %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT + should: %s[0].id == "RSC-1" + should: %s[0].name == "Afilias Limited" + should: %s[0].organization == "Afilias Limited" + should: %s[0].address == "2 La Touche House\nIFSC" + should: %s[0].city == "Dublin" + should: %s[0].zip == "1" + should: %s[0].state == "IL" + should: %s[0].country_code == "IE" + should: %s[0].phone == "+353.14310511" + should: %s[0].fax == "+353.14310557" + should: %s[0].email == "domainadmin@afilias.info" + +#admin_contacts + should: %s CLASS(array) + should: %s SIZE(1) + should: %s[0] CLASS(contact) + should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN + should: %s[0].id == "RSC-1" + should: %s[0].name == "Afilias Limited" + should: %s[0].organization == "Afilias Limited" + should: %s[0].address == "2 La Touche House\nIFSC" + should: %s[0].city == "Dublin" + should: %s[0].zip == "1" + should: %s[0].state == "IL" + should: %s[0].country_code == "IE" + should: %s[0].phone == "+353.14310511" + should: %s[0].fax == "+353.14310557" + should: %s[0].email == "domainadmin@afilias.info" + +#technical_contacts + should: %s CLASS(array) + should: %s SIZE(1) + should: %s[0] CLASS(contact) + should: %s[0].type == Whois::Record::Contact::TYPE_TECHNICAL + should: %s[0].id == "RSC-1" + should: %s[0].name == "Afilias Limited" + should: %s[0].organization == "Afilias Limited" + should: %s[0].address == "2 La Touche House\nIFSC" + should: %s[0].city == "Dublin" + should: %s[0].zip == "1" + should: %s[0].state == "IL" + should: %s[0].country_code == "IE" + should: %s[0].phone == "+353.14310511" + should: %s[0].fax == "+353.14310557" + should: %s[0].email == "domainadmin@afilias.info" + + #nameservers should: %s CLASS(array) should: %s SIZE(5) diff --git a/spec/whois/record/parser/responses/whois.aero/status_registered_spec.rb b/spec/whois/record/parser/responses/whois.aero/status_registered_spec.rb index d8b767638..746dd3c3e 100644 --- a/spec/whois/record/parser/responses/whois.aero/status_registered_spec.rb +++ b/spec/whois/record/parser/responses/whois.aero/status_registered_spec.rb @@ -92,18 +92,18 @@ @parser.registrant_contacts.should be_a(Array) @parser.registrant_contacts.should have(1).items @parser.registrant_contacts[0].should be_a(Whois::Record::Contact) - @parser.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT - @parser.registrant_contacts[0].id.should == "C4526901-AERO" - @parser.registrant_contacts[0].name.should == "Domain Name Administrator" - @parser.registrant_contacts[0].organization.should == "SriLankan Airlines Ltd" - @parser.registrant_contacts[0].address.should == "Admin Bldg" - @parser.registrant_contacts[0].city.should == "Katunayaka" - @parser.registrant_contacts[0].zip.should == "11450" - @parser.registrant_contacts[0].state.should == "WP" - @parser.registrant_contacts[0].country_code.should == "LK" - @parser.registrant_contacts[0].phone.should == "+94.197331600" - @parser.registrant_contacts[0].fax.should == "+94.197335160" - @parser.registrant_contacts[0].email.should == "domregister@srilankan.aero" + @parser.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT + @parser.registrant_contacts[0].id.should == "C4526901-AERO" + @parser.registrant_contacts[0].name.should == "Domain Name Administrator" + @parser.registrant_contacts[0].organization.should == "SriLankan Airlines Ltd" + @parser.registrant_contacts[0].address.should == "Admin Bldg" + @parser.registrant_contacts[0].city.should == "Katunayaka" + @parser.registrant_contacts[0].zip.should == "11450" + @parser.registrant_contacts[0].state.should == "WP" + @parser.registrant_contacts[0].country_code.should == "LK" + @parser.registrant_contacts[0].phone.should == "+94.197331600" + @parser.registrant_contacts[0].fax.should == "+94.197335160" + @parser.registrant_contacts[0].email.should == "domregister@srilankan.aero" end end describe "#admin_contacts" do @@ -111,18 +111,18 @@ @parser.admin_contacts.should be_a(Array) @parser.admin_contacts.should have(1).items @parser.admin_contacts[0].should be_a(Whois::Record::Contact) - @parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN - @parser.admin_contacts[0].id.should == "C4526901-AERO" - @parser.admin_contacts[0].name.should == "Domain Name Administrator" - @parser.admin_contacts[0].organization.should == "SriLankan Airlines Ltd" - @parser.admin_contacts[0].address.should == "Admin Bldg" - @parser.admin_contacts[0].city.should == "Katunayaka" - @parser.admin_contacts[0].zip.should == "11450" - @parser.admin_contacts[0].state.should == "WP" - @parser.admin_contacts[0].country_code.should == "LK" - @parser.admin_contacts[0].phone.should == "+94.197331600" - @parser.admin_contacts[0].fax.should == "+94.197335160" - @parser.admin_contacts[0].email.should == "domregister@srilankan.aero" + @parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN + @parser.admin_contacts[0].id.should == "C4526901-AERO" + @parser.admin_contacts[0].name.should == "Domain Name Administrator" + @parser.admin_contacts[0].organization.should == "SriLankan Airlines Ltd" + @parser.admin_contacts[0].address.should == "Admin Bldg" + @parser.admin_contacts[0].city.should == "Katunayaka" + @parser.admin_contacts[0].zip.should == "11450" + @parser.admin_contacts[0].state.should == "WP" + @parser.admin_contacts[0].country_code.should == "LK" + @parser.admin_contacts[0].phone.should == "+94.197331600" + @parser.admin_contacts[0].fax.should == "+94.197335160" + @parser.admin_contacts[0].email.should == "domregister@srilankan.aero" end end describe "#technical_contacts" do @@ -130,18 +130,18 @@ @parser.technical_contacts.should be_a(Array) @parser.technical_contacts.should have(1).items @parser.technical_contacts[0].should be_a(Whois::Record::Contact) - @parser.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL - @parser.technical_contacts[0].id.should == "C4526901-AERO" - @parser.technical_contacts[0].name.should == "Domain Name Administrator" - @parser.technical_contacts[0].organization.should == "SriLankan Airlines Ltd" - @parser.technical_contacts[0].address.should == "Admin Bldg" - @parser.technical_contacts[0].city.should == "Katunayaka" - @parser.technical_contacts[0].zip.should == "11450" - @parser.technical_contacts[0].state.should == "WP" - @parser.technical_contacts[0].country_code.should == "LK" - @parser.technical_contacts[0].phone.should == "+94.197331600" - @parser.technical_contacts[0].fax.should == "+94.197335160" - @parser.technical_contacts[0].email.should == "domregister@srilankan.aero" + @parser.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL + @parser.technical_contacts[0].id.should == "C4526901-AERO" + @parser.technical_contacts[0].name.should == "Domain Name Administrator" + @parser.technical_contacts[0].organization.should == "SriLankan Airlines Ltd" + @parser.technical_contacts[0].address.should == "Admin Bldg" + @parser.technical_contacts[0].city.should == "Katunayaka" + @parser.technical_contacts[0].zip.should == "11450" + @parser.technical_contacts[0].state.should == "WP" + @parser.technical_contacts[0].country_code.should == "LK" + @parser.technical_contacts[0].phone.should == "+94.197331600" + @parser.technical_contacts[0].fax.should == "+94.197335160" + @parser.technical_contacts[0].email.should == "domregister@srilankan.aero" end end describe "#nameservers" do diff --git a/spec/whois/record/parser/responses/whois.registrypro.pro/status_available_spec.rb b/spec/whois/record/parser/responses/whois.registrypro.pro/status_available_spec.rb index 6c23162b4..560535e08 100644 --- a/spec/whois/record/parser/responses/whois.registrypro.pro/status_available_spec.rb +++ b/spec/whois/record/parser/responses/whois.registrypro.pro/status_available_spec.rb @@ -21,6 +21,31 @@ @parser = klass.new(part) end + describe "#disclaimer" do + it do + @parser.disclaimer.should == nil + end + end + describe "#domain" do + it do + @parser.domain.should == nil + end + end + describe "#domain_id" do + it do + @parser.domain_id.should == nil + end + end + describe "#referral_whois" do + it do + lambda { @parser.referral_whois }.should raise_error(Whois::PropertyNotSupported) + end + end + describe "#referral_url" do + it do + lambda { @parser.referral_url }.should raise_error(Whois::PropertyNotSupported) + end + end describe "#status" do it do @parser.status.should == [] @@ -51,6 +76,29 @@ @parser.expires_on.should == nil end end + describe "#registrar" do + it do + @parser.registrar.should == nil + end + end + describe "#registrant_contacts" do + it do + @parser.registrant_contacts.should be_a(Array) + @parser.registrant_contacts.should == [] + end + end + describe "#admin_contacts" do + it do + @parser.admin_contacts.should be_a(Array) + @parser.admin_contacts.should == [] + end + end + describe "#technical_contacts" do + it do + @parser.technical_contacts.should be_a(Array) + @parser.technical_contacts.should == [] + end + end describe "#nameservers" do it do @parser.nameservers.should be_a(Array) diff --git a/spec/whois/record/parser/responses/whois.registrypro.pro/status_registered_spec.rb b/spec/whois/record/parser/responses/whois.registrypro.pro/status_registered_spec.rb index ca84a8792..818ec39b6 100644 --- a/spec/whois/record/parser/responses/whois.registrypro.pro/status_registered_spec.rb +++ b/spec/whois/record/parser/responses/whois.registrypro.pro/status_registered_spec.rb @@ -21,6 +21,31 @@ @parser = klass.new(part) end + describe "#disclaimer" do + it do + @parser.disclaimer.should == "Access to .PRO REGISTRY WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the .PRO Registry registry database. The data in this record is provided by .PRO Registry for informational purposes only, and .PRO Registry does not guarantee its accuracy. This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: (a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or Afilias except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. .PRO Registry reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy." + end + end + describe "#domain" do + it do + @parser.domain.should == "registrypro.pro" + end + end + describe "#domain_id" do + it do + @parser.domain_id.should == "D6394-PRO" + end + end + describe "#referral_whois" do + it do + lambda { @parser.referral_whois }.should raise_error(Whois::PropertyNotSupported) + end + end + describe "#referral_url" do + it do + lambda { @parser.referral_url }.should raise_error(Whois::PropertyNotSupported) + end + end describe "#status" do it do @parser.status.should == ["CLIENT TRANSFER PROHIBITED", "DELETE PROHIBITED"] @@ -54,6 +79,71 @@ @parser.expires_on.should == Time.parse("2017-01-26 00:00:00 UTC") end end + describe "#registrar" do + it do + @parser.registrar.should be_a(Whois::Record::Registrar) + @parser.registrar.id.should == "R2338-PRO" + @parser.registrar.name.should == "Corporation Service Company dba CSC Corporate Domains, Inc" + @parser.registrar.organization.should == "Corporation Service Company dba CSC Corporate Domains, Inc" + end + end + describe "#registrant_contacts" do + it do + @parser.registrant_contacts.should be_a(Array) + @parser.registrant_contacts.should have(1).items + @parser.registrant_contacts[0].should be_a(Whois::Record::Contact) + @parser.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT + @parser.registrant_contacts[0].id.should == "RSC-1" + @parser.registrant_contacts[0].name.should == "Afilias Limited" + @parser.registrant_contacts[0].organization.should == "Afilias Limited" + @parser.registrant_contacts[0].address.should == "2 La Touche House\nIFSC" + @parser.registrant_contacts[0].city.should == "Dublin" + @parser.registrant_contacts[0].zip.should == "1" + @parser.registrant_contacts[0].state.should == "IL" + @parser.registrant_contacts[0].country_code.should == "IE" + @parser.registrant_contacts[0].phone.should == "+353.14310511" + @parser.registrant_contacts[0].fax.should == "+353.14310557" + @parser.registrant_contacts[0].email.should == "domainadmin@afilias.info" + end + end + describe "#admin_contacts" do + it do + @parser.admin_contacts.should be_a(Array) + @parser.admin_contacts.should have(1).items + @parser.admin_contacts[0].should be_a(Whois::Record::Contact) + @parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN + @parser.admin_contacts[0].id.should == "RSC-1" + @parser.admin_contacts[0].name.should == "Afilias Limited" + @parser.admin_contacts[0].organization.should == "Afilias Limited" + @parser.admin_contacts[0].address.should == "2 La Touche House\nIFSC" + @parser.admin_contacts[0].city.should == "Dublin" + @parser.admin_contacts[0].zip.should == "1" + @parser.admin_contacts[0].state.should == "IL" + @parser.admin_contacts[0].country_code.should == "IE" + @parser.admin_contacts[0].phone.should == "+353.14310511" + @parser.admin_contacts[0].fax.should == "+353.14310557" + @parser.admin_contacts[0].email.should == "domainadmin@afilias.info" + end + end + describe "#technical_contacts" do + it do + @parser.technical_contacts.should be_a(Array) + @parser.technical_contacts.should have(1).items + @parser.technical_contacts[0].should be_a(Whois::Record::Contact) + @parser.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL + @parser.technical_contacts[0].id.should == "RSC-1" + @parser.technical_contacts[0].name.should == "Afilias Limited" + @parser.technical_contacts[0].organization.should == "Afilias Limited" + @parser.technical_contacts[0].address.should == "2 La Touche House\nIFSC" + @parser.technical_contacts[0].city.should == "Dublin" + @parser.technical_contacts[0].zip.should == "1" + @parser.technical_contacts[0].state.should == "IL" + @parser.technical_contacts[0].country_code.should == "IE" + @parser.technical_contacts[0].phone.should == "+353.14310511" + @parser.technical_contacts[0].fax.should == "+353.14310557" + @parser.technical_contacts[0].email.should == "domainadmin@afilias.info" + end + end describe "#nameservers" do it do @parser.nameservers.should be_a(Array)