Skip to content
This repository
Browse code

Merge branch 'whois.ati.tn'

  • Loading branch information...
commit 6bb777ab35965983ff156e8e1fa41c72414a293b 2 parents 3716db1 + 00019a6
Simone Carletti authored
4 CHANGELOG.md
Source Rendered
@@ -5,10 +5,14 @@
5 5
6 6 * SERVER: Added .OM TLD server.
7 7
  8 +* SERVER: Added .TN TLD server.
  9 +
8 10 * NEW: whois.srs.net.nz parser now recognizes throttled responses.
9 11
10 12 * NEW: Added full whois.registry.om parser.
11 13
  14 +* NEW: Added full whois.ati.tn parser.
  15 +
12 16 * NEW: Implement registrar property for CoCCA (GH-165). [Thanks @sherwind]
13 17
14 18 * CHANGED: whois.nic.uk changed response format.
2  lib/whois/definitions/tlds.rb
@@ -284,7 +284,7 @@
284 284 Whois::Server.define :tld, ".tk", "whois.dot.tk"
285 285 Whois::Server.define :tld, ".tl", "whois.nic.tl"
286 286 Whois::Server.define :tld, ".tm", "whois.nic.tm"
287   -Whois::Server.define :tld, ".tn", nil, { :web => "http://whois.ati.tn/", :adapter => Whois::Server::Adapters::Web }
  287 +Whois::Server.define :tld, ".tn", "whois.ati.tn"
288 288 Whois::Server.define :tld, ".to", "whois.tonic.to"
289 289 Whois::Server.define :tld, ".tp", nil, { :adapter => Whois::Server::Adapters::None }
290 290 Whois::Server.define :tld, ".tr", "whois.nic.tr"
133 lib/whois/record/parser/whois.ati.tn.rb
... ... @@ -0,0 +1,133 @@
  1 +#--
  2 +# Ruby Whois
  3 +#
  4 +# An intelligent pure Ruby WHOIS client and parser.
  5 +#
  6 +# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
  7 +#++
  8 +
  9 +
  10 +require 'whois/record/parser/base'
  11 +require 'whois/record/scanners/whois.ati.tn.rb'
  12 +
  13 +
  14 +module Whois
  15 + class Record
  16 + class Parser
  17 +
  18 + # Parser for the whois.ati.tn server.
  19 + #
  20 + # @see Whois::Record::Parser::Example
  21 + # The Example parser for the list of all available methods.
  22 + #
  23 + # @since RELEASE
  24 + class WhoisAtiTn < Base
  25 + include Scanners::Ast
  26 +
  27 + property_supported :disclaimer do
  28 + node("field:disclaimer")
  29 + end
  30 +
  31 +
  32 + property_supported :domain do
  33 + node("Domain")
  34 + end
  35 +
  36 + property_not_supported :domain_id
  37 +
  38 +
  39 + property_not_supported :referral_whois
  40 +
  41 + property_not_supported :referral_url
  42 +
  43 +
  44 + property_supported :status do
  45 + if available?
  46 + :available
  47 + else
  48 + :registered
  49 + end
  50 + end
  51 +
  52 + property_supported :available? do
  53 + !!node("status:available")
  54 + end
  55 +
  56 + property_supported :registered? do
  57 + !available?
  58 + end
  59 +
  60 +
  61 + property_supported :created_on do
  62 + node("Acivated") { |value| Time.parse(value) }
  63 + end
  64 +
  65 + property_not_supported :updated_on
  66 +
  67 + property_not_supported :expires_on
  68 +
  69 +
  70 + property_supported :registrar do
  71 + node("Registrar") do |str|
  72 + Record::Registrar.new(
  73 + :id => nil,
  74 + :name => node("Registrar")
  75 + )
  76 + end
  77 + end
  78 +
  79 +
  80 + property_supported :registrant_contacts do
  81 + build_contact("Owner", Whois::Record::Contact::TYPE_REGISTRANT)
  82 + end
  83 +
  84 + property_supported :admin_contacts do
  85 + build_contact("Admin.", Whois::Record::Contact::TYPE_ADMIN)
  86 + end
  87 +
  88 + property_supported :technical_contacts do
  89 + build_contact("Tech.", Whois::Record::Contact::TYPE_TECHNICAL)
  90 + end
  91 +
  92 +
  93 + property_supported :nameservers do
  94 + Array.wrap(node("NameServers")).map do |line|
  95 + name, ipv4 = line.match(/(.+)\. \[(.+)\]/)[1, 2]
  96 + Nameserver.new(:name => name, :ipv4 => ipv4)
  97 + end
  98 + end
  99 +
  100 +
  101 + # Initializes a new {Scanners::WhoisAtiTn} instance
  102 + # passing the {#content_for_scanner}
  103 + # and calls +parse+ on it.
  104 + #
  105 + # @return [Hash]
  106 + def parse
  107 + Scanners::WhoisAtiTn.new(content_for_scanner).parse
  108 + end
  109 +
  110 +
  111 + private
  112 +
  113 + def build_contact(element, type)
  114 + node("#{element} Name") do
  115 + Record::Contact.new(
  116 + :type => type,
  117 + :id => nil,
  118 + :name => node("#{element} Name"),
  119 + :address => node("#{element} Address"),
  120 + :phone => node("#{element} Tel"),
  121 + :fax => node("#{element} Fax"),
  122 + :email => node("#{element} Email"),
  123 + :created_on => node("#{element} Created") { |value| Time.parse(value) },
  124 + :updated_on => node("#{element} Updated") { |value| Time.parse(value) }
  125 + )
  126 + end
  127 + end
  128 +
  129 + end
  130 +
  131 + end
  132 + end
  133 +end
46 lib/whois/record/scanners/whois.ati.tn.rb
... ... @@ -0,0 +1,46 @@
  1 +#--
  2 +# Ruby Whois
  3 +#
  4 +# An intelligent pure Ruby WHOIS client and parser.
  5 +#
  6 +# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
  7 +#++
  8 +
  9 +
  10 +require 'whois/record/scanners/base'
  11 +
  12 +
  13 +module Whois
  14 + class Record
  15 + module Scanners
  16 +
  17 + # Scanner for the whois.ati.tn record.
  18 + #
  19 + # @since RELEASE
  20 + class WhoisAtiTn < Base
  21 +
  22 + self.tokenizers += [
  23 + :skip_empty_line,
  24 + :scan_available,
  25 + :scan_disclaimer,
  26 + :scan_keyvalue,
  27 + ]
  28 +
  29 +
  30 + tokenizer :scan_available do
  31 + if @input.skip(/^Domain (.+) not found/)
  32 + @ast["status:available"] = true
  33 + end
  34 + end
  35 +
  36 + tokenizer :scan_disclaimer do
  37 + if @input.match?(/^All rights reserved/)
  38 + @ast["field:disclaimer"] = _scan_lines_to_array(/(.+)\n/).join("\n")
  39 + end
  40 + end
  41 +
  42 + end
  43 +
  44 + end
  45 + end
  46 +end
1  lib/whois/record/scanners/whois.cira.ca.rb
@@ -29,7 +29,6 @@ class WhoisCiraCa < Base
29 29 ]
30 30
31 31
32   -
33 32 tokenizer :scan_disclaimer do
34 33 if @input.match?(/^% Use of CIRA/)
35 34 @ast["field:disclaimer"] = _scan_lines_to_array(/^%(.*)\n/).join("\n")
57 spec/fixtures/responses/whois.ati.tn/status_available.expected
... ... @@ -0,0 +1,57 @@
  1 +#disclaimer
  2 + should: %s == "All rights reserved.\nCopyright \"Tunisian Internet Agency - http://whois.tn\""
  3 +
  4 +
  5 +#domain
  6 + should: %s == nil
  7 +
  8 +#domain_id
  9 + should: %s raise_error(Whois::PropertyNotSupported)
  10 +
  11 +
  12 +#referral_url
  13 + should: %s raise_error(Whois::PropertyNotSupported)
  14 +
  15 +#referral_whois
  16 + should: %s raise_error(Whois::PropertyNotSupported)
  17 +
  18 +
  19 +#status
  20 + should: %s == :available
  21 +
  22 +#available?
  23 + should: %s == true
  24 +
  25 +#registered?
  26 + should: %s == false
  27 +
  28 +
  29 +#created_on
  30 + should: %s == nil
  31 +
  32 +#updated_on
  33 + should: %s raise_error(Whois::PropertyNotSupported)
  34 +
  35 +#expires_on
  36 + should: %s raise_error(Whois::PropertyNotSupported)
  37 +
  38 +
  39 +#registrar
  40 + should: %s == nil
  41 +
  42 +#registrant_contacts
  43 + should: %s CLASS(array)
  44 + should: %s == []
  45 +
  46 +#admin_contacts
  47 + should: %s CLASS(array)
  48 + should: %s == []
  49 +
  50 +#technical_contacts
  51 + should: %s CLASS(array)
  52 + should: %s == []
  53 +
  54 +
  55 +#nameservers
  56 + should: %s CLASS(array)
  57 + should: %s == []
4 spec/fixtures/responses/whois.ati.tn/status_available.txt
... ... @@ -0,0 +1,4 @@
  1 +All rights reserved.
  2 +Copyright "Tunisian Internet Agency - http://whois.tn"
  3 +
  4 +Domain u34jedzcq.tn not found
122 spec/fixtures/responses/whois.ati.tn/status_registered.expected
... ... @@ -0,0 +1,122 @@
  1 +#disclaimer
  2 + should: %s == "All rights reserved.\nCopyright \"Tunisian Internet Agency - http://whois.tn\""
  3 +
  4 +
  5 +#domain
  6 + should: %s == "google.tn"
  7 +
  8 +#domain_id
  9 + should: %s raise_error(Whois::PropertyNotSupported)
  10 +
  11 +
  12 +#referral_url
  13 + should: %s raise_error(Whois::PropertyNotSupported)
  14 +
  15 +#referral_whois
  16 + should: %s raise_error(Whois::PropertyNotSupported)
  17 +
  18 +
  19 +#status
  20 + should: %s == :registered
  21 +
  22 +#available?
  23 + should: %s == false
  24 +
  25 +#registered?
  26 + should: %s == true
  27 +
  28 +
  29 +#created_on
  30 + should: %s CLASS(time)
  31 + should: %s == Time.parse("2009-05-14 00:00:00")
  32 +
  33 +#updated_on
  34 + should: %s raise_error(Whois::PropertyNotSupported)
  35 +
  36 +#expires_on
  37 + should: %s raise_error(Whois::PropertyNotSupported)
  38 +
  39 +
  40 +#registrar
  41 + should: %s CLASS(registrar)
  42 + should: %s.id == nil
  43 + should: %s.name == "3S Global Net"
  44 + should: %s.organization == nil
  45 + should: %s.url == nil
  46 +
  47 +#registrant_contacts
  48 + should: %s CLASS(array)
  49 + should: %s SIZE(1)
  50 + should: %s[0] CLASS(contact)
  51 + should: %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT
  52 + should: %s[0].id == nil
  53 + should: %s[0].name == "GOOGLE Inc"
  54 + should: %s[0].organization == nil
  55 + should: %s[0].address == "PO BOX 2050 Moutain view CA 94042 USA"
  56 + should: %s[0].city == nil
  57 + should: %s[0].zip == nil
  58 + should: %s[0].state == nil
  59 + should: %s[0].country == nil
  60 + should: %s[0].country_code == nil
  61 + should: %s[0].phone == "+1 925 685 9600"
  62 + should: %s[0].fax == "+1 925 685 9620"
  63 + should: %s[0].email == "dns-admin@google.com"
  64 + should: %s[0].created_on == Time.parse("2009-05-14 00:00:00")
  65 + should: %s[0].updated_on == Time.parse("2010-07-18 00:00:00")
  66 +
  67 +#admin_contacts
  68 + should: %s CLASS(array)
  69 + should: %s SIZE(1)
  70 + should: %s[0] CLASS(contact)
  71 + should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN
  72 + should: %s[0].id == nil
  73 + should: %s[0].name == "GOOGLE Inc"
  74 + should: %s[0].organization == nil
  75 + should: %s[0].address == "PO BOX 2050 Moutain view CA 94042 USA"
  76 + should: %s[0].city == nil
  77 + should: %s[0].zip == nil
  78 + should: %s[0].state == nil
  79 + should: %s[0].country == nil
  80 + should: %s[0].country_code == nil
  81 + should: %s[0].phone == "+1 925 685 9600"
  82 + should: %s[0].fax == "+1 925 685 9620"
  83 + should: %s[0].email == "dns-admin@google.com"
  84 + should: %s[0].created_on == Time.parse("2009-05-14 00:00:00")
  85 + should: %s[0].updated_on == Time.parse("2010-07-18 00:00:00")
  86 +
  87 +#technical_contacts
  88 + should: %s CLASS(array)
  89 + should: %s SIZE(1)
  90 + should: %s[0] CLASS(contact)
  91 + should: %s[0].type == Whois::Record::Contact::TYPE_TECHNICAL
  92 + should: %s[0].id == nil
  93 + should: %s[0].name == "GOOGLE Inc"
  94 + should: %s[0].organization == nil
  95 + should: %s[0].address == "PO BOX 2050 Moutain view CA 94042 USA"
  96 + should: %s[0].city == nil
  97 + should: %s[0].zip == nil
  98 + should: %s[0].state == nil
  99 + should: %s[0].country == nil
  100 + should: %s[0].country_code == nil
  101 + should: %s[0].phone == "+1 925 685 9600"
  102 + should: %s[0].fax == "+1 925 685 9620"
  103 + should: %s[0].email == "dns-admin@google.com"
  104 + should: %s[0].created_on == Time.parse("2009-05-14 00:00:00")
  105 + should: %s[0].updated_on == Time.parse("2010-07-18 00:00:00")
  106 +
  107 +
  108 +#nameservers
  109 + should: %s CLASS(array)
  110 + should: %s SIZE(4)
  111 + should: %s[0] CLASS(nameserver)
  112 + should: %s[0].name == "ns1.google.com"
  113 + should: %s[0].ipv4 == "216.239.32.10"
  114 + should: %s[1] CLASS(nameserver)
  115 + should: %s[1].name == "ns2.google.com"
  116 + should: %s[1].ipv4 == "216.239.34.10"
  117 + should: %s[2] CLASS(nameserver)
  118 + should: %s[2].name == "ns3.google.com"
  119 + should: %s[2].ipv4 == "216.239.36.10"
  120 + should: %s[3] CLASS(nameserver)
  121 + should: %s[3].name == "ns4.google.com"
  122 + should: %s[3].ipv4 == "216.239.38.10"
36 spec/fixtures/responses/whois.ati.tn/status_registered.txt
... ... @@ -0,0 +1,36 @@
  1 +All rights reserved.
  2 +Copyright "Tunisian Internet Agency - http://whois.tn"
  3 +
  4 +Domain : google.tn
  5 +Acivated : 2009-05-14 00:00:00
  6 +Registrar : 3S Global Net
  7 +
  8 +NameServers : ns1.google.com. [216.239.32.10]
  9 +NameServers : ns2.google.com. [216.239.34.10]
  10 +NameServers : ns3.google.com. [216.239.36.10]
  11 +NameServers : ns4.google.com. [216.239.38.10]
  12 +
  13 +Owner Name : GOOGLE Inc
  14 +Owner Address : PO BOX 2050 Moutain view CA 94042 USA
  15 +Owner Tel : +1 925 685 9600
  16 +Owner Fax : +1 925 685 9620
  17 +Owner Email : dns-admin@google.com
  18 +Owner Created : 2009-05-14 00:00:00
  19 +Owner Updated : 2010-07-18 00:00:00
  20 +
  21 +Admin. Name : GOOGLE Inc
  22 +Admin. Address : PO BOX 2050 Moutain view CA 94042 USA
  23 +Admin. Tel : +1 925 685 9600
  24 +Admin. Fax : +1 925 685 9620
  25 +Admin. Email : dns-admin@google.com
  26 +Admin. Created : 2009-05-14 00:00:00
  27 +Admin. Updated : 2010-07-18 00:00:00
  28 +
  29 +Tech. Name : GOOGLE Inc
  30 +Tech. Address : PO BOX 2050 Moutain view CA 94042 USA
  31 +Tech. Tel : +1 925 685 9600
  32 +Tech. Fax : +1 925 685 9620
  33 +Tech. Email : dns-admin@google.com
  34 +Tech. Created : 2009-05-14 00:00:00
  35 +Tech. Updated : 2010-07-18 00:00:00
  36 +
2  spec/tlds
@@ -279,7 +279,7 @@ tk;whois.dot.tk;thinkcode.tk;u34jedzcq.tk
279 279 tl;whois.nic.tl;thinkcode.tl;u34jedzcq.tl
280 280 tld;registry;available;unavailable
281 281 tm;whois.nic.tm;google.tm;u34jedzcq.tm
282   -tn;;;
  282 +tn;whois.ati.tn;google.tn;u34jedzcq.tn
283 283 to;whois.tonic.to;go.to;u34jedzcq.to
284 284 tp;;;
285 285 tr;whois.nic.tr;google.com.tr;u34jedzcq.com.tr
108 spec/whois/record/parser/responses/whois.ati.tn/status_available_spec.rb
... ... @@ -0,0 +1,108 @@
  1 +# encoding: utf-8
  2 +
  3 +# This file is autogenerated. Do not edit it manually.
  4 +# If you want change the content of this file, edit
  5 +#
  6 +# /spec/fixtures/responses/whois.ati.tn/status_available.expected
  7 +#
  8 +# and regenerate the tests with the following rake task
  9 +#
  10 +# $ rake spec:generate
  11 +#
  12 +
  13 +require 'spec_helper'
  14 +require 'whois/record/parser/whois.ati.tn.rb'
  15 +
  16 +describe Whois::Record::Parser::WhoisAtiTn, "status_available.expected" do
  17 +
  18 + before(:each) do
  19 + file = fixture("responses", "whois.ati.tn/status_available.txt")
  20 + part = Whois::Record::Part.new(:body => File.read(file))
  21 + @parser = klass.new(part)
  22 + end
  23 +
  24 + describe "#disclaimer" do
  25 + it do
  26 + @parser.disclaimer.should == "All rights reserved.\nCopyright \"Tunisian Internet Agency - http://whois.tn\""
  27 + end
  28 + end
  29 + describe "#domain" do
  30 + it do
  31 + @parser.domain.should == nil
  32 + end
  33 + end
  34 + describe "#domain_id" do
  35 + it do
  36 + lambda { @parser.domain_id }.should raise_error(Whois::PropertyNotSupported)
  37 + end
  38 + end
  39 + describe "#referral_url" do
  40 + it do
  41 + lambda { @parser.referral_url }.should raise_error(Whois::PropertyNotSupported)
  42 + end
  43 + end
  44 + describe "#referral_whois" do
  45 + it do
  46 + lambda { @parser.referral_whois }.should raise_error(Whois::PropertyNotSupported)
  47 + end
  48 + end
  49 + describe "#status" do
  50 + it do
  51 + @parser.status.should == :available
  52 + end
  53 + end
  54 + describe "#available?" do
  55 + it do
  56 + @parser.available?.should == true
  57 + end
  58 + end
  59 + describe "#registered?" do
  60 + it do
  61 + @parser.registered?.should == false
  62 + end
  63 + end
  64 + describe "#created_on" do
  65 + it do
  66 + @parser.created_on.should == nil
  67 + end
  68 + end
  69 + describe "#updated_on" do
  70 + it do
  71 + lambda { @parser.updated_on }.should raise_error(Whois::PropertyNotSupported)
  72 + end
  73 + end
  74 + describe "#expires_on" do
  75 + it do
  76 + lambda { @parser.expires_on }.should raise_error(Whois::PropertyNotSupported)
  77 + end
  78 + end
  79 + describe "#registrar" do
  80 + it do
  81 + @parser.registrar.should == nil
  82 + end
  83 + end
  84 + describe "#registrant_contacts" do
  85 + it do
  86 + @parser.registrant_contacts.should be_a(Array)
  87 + @parser.registrant_contacts.should == []
  88 + end
  89 + end
  90 + describe "#admin_contacts" do
  91 + it do
  92 + @parser.admin_contacts.should be_a(Array)
  93 + @parser.admin_contacts.should == []
  94 + end
  95 + end
  96 + describe "#technical_contacts" do
  97 + it do
  98 + @parser.technical_contacts.should be_a(Array)
  99 + @parser.technical_contacts.should == []
  100 + end
  101 + end
  102 + describe "#nameservers" do
  103 + it do
  104 + @parser.nameservers.should be_a(Array)
  105 + @parser.nameservers.should == []
  106 + end
  107 + end
  108 +end
173 spec/whois/record/parser/responses/whois.ati.tn/status_registered_spec.rb
... ... @@ -0,0 +1,173 @@
  1 +# encoding: utf-8
  2 +
  3 +# This file is autogenerated. Do not edit it manually.
  4 +# If you want change the content of this file, edit
  5 +#
  6 +# /spec/fixtures/responses/whois.ati.tn/status_registered.expected
  7 +#
  8 +# and regenerate the tests with the following rake task
  9 +#
  10 +# $ rake spec:generate
  11 +#
  12 +
  13 +require 'spec_helper'
  14 +require 'whois/record/parser/whois.ati.tn.rb'
  15 +
  16 +describe Whois::Record::Parser::WhoisAtiTn, "status_registered.expected" do
  17 +
  18 + before(:each) do
  19 + file = fixture("responses", "whois.ati.tn/status_registered.txt")
  20 + part = Whois::Record::Part.new(:body => File.read(file))
  21 + @parser = klass.new(part)
  22 + end
  23 +
  24 + describe "#disclaimer" do
  25 + it do
  26 + @parser.disclaimer.should == "All rights reserved.\nCopyright \"Tunisian Internet Agency - http://whois.tn\""
  27 + end
  28 + end
  29 + describe "#domain" do
  30 + it do
  31 + @parser.domain.should == "google.tn"
  32 + end
  33 + end
  34 + describe "#domain_id" do
  35 + it do
  36 + lambda { @parser.domain_id }.should raise_error(Whois::PropertyNotSupported)
  37 + end
  38 + end
  39 + describe "#referral_url" do
  40 + it do
  41 + lambda { @parser.referral_url }.should raise_error(Whois::PropertyNotSupported)
  42 + end
  43 + end
  44 + describe "#referral_whois" do
  45 + it do
  46 + lambda { @parser.referral_whois }.should raise_error(Whois::PropertyNotSupported)
  47 + end
  48 + end
  49 + describe "#status" do
  50 + it do
  51 + @parser.status.should == :registered
  52 + end
  53 + end
  54 + describe "#available?" do
  55 + it do
  56 + @parser.available?.should == false
  57 + end
  58 + end
  59 + describe "#registered?" do
  60 + it do
  61 + @parser.registered?.should == true
  62 + end
  63 + end
  64 + describe "#created_on" do
  65 + it do
  66 + @parser.created_on.should be_a(Time)
  67 + @parser.created_on.should == Time.parse("2009-05-14 00:00:00")
  68 + end
  69 + end
  70 + describe "#updated_on" do
  71 + it do
  72 + lambda { @parser.updated_on }.should raise_error(Whois::PropertyNotSupported)
  73 + end
  74 + end
  75 + describe "#expires_on" do
  76 + it do
  77 + lambda { @parser.expires_on }.should raise_error(Whois::PropertyNotSupported)
  78 + end
  79 + end
  80 + describe "#registrar" do
  81 + it do
  82 + @parser.registrar.should be_a(Whois::Record::Registrar)
  83 + @parser.registrar.id.should == nil
  84 + @parser.registrar.name.should == "3S Global Net"
  85 + @parser.registrar.organization.should == nil
  86 + @parser.registrar.url.should == nil
  87 + end
  88 + end
  89 + describe "#registrant_contacts" do
  90 + it do
  91 + @parser.registrant_contacts.should be_a(Array)
  92 + @parser.registrant_contacts.should have(1).items
  93 + @parser.registrant_contacts[0].should be_a(Whois::Record::Contact)
  94 + @parser.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT
  95 + @parser.registrant_contacts[0].id.should == nil
  96 + @parser.registrant_contacts[0].name.should == "GOOGLE Inc"
  97 + @parser.registrant_contacts[0].organization.should == nil
  98 + @parser.registrant_contacts[0].address.should == "PO BOX 2050 Moutain view CA 94042 USA"
  99 + @parser.registrant_contacts[0].city.should == nil
  100 + @parser.registrant_contacts[0].zip.should == nil
  101 + @parser.registrant_contacts[0].state.should == nil
  102 + @parser.registrant_contacts[0].country.should == nil
  103 + @parser.registrant_contacts[0].country_code.should == nil
  104 + @parser.registrant_contacts[0].phone.should == "+1 925 685 9600"
  105 + @parser.registrant_contacts[0].fax.should == "+1 925 685 9620"
  106 + @parser.registrant_contacts[0].email.should == "dns-admin@google.com"
  107 + @parser.registrant_contacts[0].created_on.should == Time.parse("2009-05-14 00:00:00")
  108 + @parser.registrant_contacts[0].updated_on.should == Time.parse("2010-07-18 00:00:00")
  109 + end
  110 + end
  111 + describe "#admin_contacts" do
  112 + it do
  113 + @parser.admin_contacts.should be_a(Array)
  114 + @parser.admin_contacts.should have(1).items
  115 + @parser.admin_contacts[0].should be_a(Whois::Record::Contact)
  116 + @parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN
  117 + @parser.admin_contacts[0].id.should == nil
  118 + @parser.admin_contacts[0].name.should == "GOOGLE Inc"
  119 + @parser.admin_contacts[0].organization.should == nil
  120 + @parser.admin_contacts[0].address.should == "PO BOX 2050 Moutain view CA 94042 USA"
  121 + @parser.admin_contacts[0].city.should == nil
  122 + @parser.admin_contacts[0].zip.should == nil
  123 + @parser.admin_contacts[0].state.should == nil
  124 + @parser.admin_contacts[0].country.should == nil
  125 + @parser.admin_contacts[0].country_code.should == nil
  126 + @parser.admin_contacts[0].phone.should == "+1 925 685 9600"
  127 + @parser.admin_contacts[0].fax.should == "+1 925 685 9620"
  128 + @parser.admin_contacts[0].email.should == "dns-admin@google.com"
  129 + @parser.admin_contacts[0].created_on.should == Time.parse("2009-05-14 00:00:00")
  130 + @parser.admin_contacts[0].updated_on.should == Time.parse("2010-07-18 00:00:00")
  131 + end
  132 + end
  133 + describe "#technical_contacts" do
  134 + it do
  135 + @parser.technical_contacts.should be_a(Array)
  136 + @parser.technical_contacts.should have(1).items
  137 + @parser.technical_contacts[0].should be_a(Whois::Record::Contact)
  138 + @parser.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL
  139 + @parser.technical_contacts[0].id.should == nil
  140 + @parser.technical_contacts[0].name.should == "GOOGLE Inc"
  141 + @parser.technical_contacts[0].organization.should == nil
  142 + @parser.technical_contacts[0].address.should == "PO BOX 2050 Moutain view CA 94042 USA"
  143 + @parser.technical_contacts[0].city.should == nil
  144 + @parser.technical_contacts[0].zip.should == nil
  145 + @parser.technical_contacts[0].state.should == nil
  146 + @parser.technical_contacts[0].country.should == nil
  147 + @parser.technical_contacts[0].country_code.should == nil
  148 + @parser.technical_contacts[0].phone.should == "+1 925 685 9600"
  149 + @parser.technical_contacts[0].fax.should == "+1 925 685 9620"
  150 + @parser.technical_contacts[0].email.should == "dns-admin@google.com"
  151 + @parser.technical_contacts[0].created_on.should == Time.parse("2009-05-14 00:00:00")
  152 + @parser.technical_contacts[0].updated_on.should == Time.parse("2010-07-18 00:00:00")
  153 + end
  154 + end
  155 + describe "#nameservers" do
  156 + it do
  157 + @parser.nameservers.should be_a(Array)
  158 + @parser.nameservers.should have(4).items
  159 + @parser.nameservers[0].should be_a(Whois::Record::Nameserver)
  160 + @parser.nameservers[0].name.should == "ns1.google.com"
  161 + @parser.nameservers[0].ipv4.should == "216.239.32.10"
  162 + @parser.nameservers[1].should be_a(Whois::Record::Nameserver)
  163 + @parser.nameservers[1].name.should == "ns2.google.com"
  164 + @parser.nameservers[1].ipv4.should == "216.239.34.10"
  165 + @parser.nameservers[2].should be_a(Whois::Record::Nameserver)
  166 + @parser.nameservers[2].name.should == "ns3.google.com"
  167 + @parser.nameservers[2].ipv4.should == "216.239.36.10"
  168 + @parser.nameservers[3].should be_a(Whois::Record::Nameserver)
  169 + @parser.nameservers[3].name.should == "ns4.google.com"
  170 + @parser.nameservers[3].ipv4.should == "216.239.38.10"
  171 + end
  172 + end
  173 +end

0 comments on commit 6bb777a

Please sign in to comment.
Something went wrong with that request. Please try again.