Permalink
Browse files

whois.nic.cx parser must support `Delegated' status (closes GH-121).

  • Loading branch information...
1 parent 48657c9 commit 8990f54fbcc5ac0c4fa5b9b42c70e89104cb455d @weppos committed Oct 12, 2011
View
@@ -10,6 +10,8 @@
* FIXED: whois.registry.gy parser must support `Delegated' status (#120).
+* FIXED: whois.nic.cx parser must support `Delegated' status (#121).
+
== Release 2.1.1
@@ -30,12 +30,11 @@ class WhoisNicCx < Base
property_supported :status do
if content_for_scanner =~ /Status:\s+(.+?)\n/
case $1.downcase
- when "active"
- :registered
- when "not registered"
- :available
- else
- Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ when "active" then :registered
+ when "delegated" then :registered
+ when "not registered" then :available
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
else
Whois.bug!(ParserError, "Unable to parse status.")
@@ -0,0 +1,8 @@
+#status
+ should: %s == :registered
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == true
@@ -0,0 +1,68 @@
+TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by Christmas Island Internet Administration Limited ("CiiA").
+
+CiiA makes every effort to maintain the completeness and accuracy of the Whois data, but cannot guarantee that the results are error-free. Therefore, any data provided through the Whois service are on an "as is" basis without any warranties. BY USING THE WHOIS SERVICE AND THE DATA CONTAINED HEREIN OR IN ANY REPORT GENERATED WITH RESPECT THERETO, IT IS ACCEPTED THAT CIIA IS NOT LIABLE FOR ANY DAMAGES OF ANY KIND ARISING OUT OF, OR IN CONNECTION WITH, THE REPORT OR THE INFORMATION PROVIDED BY THE WHOIS SERVICE, NOR OMISSIONS OR MISSING INFORMATION. THE RESULTS OF ANY WHOIS REPORT OR INFORMATION PROVIDED BY THE WHOIS SERVICE CANNOT BE RELIED UPON IN CONTEMPLATION OF LEGAL PROCEEDINGS WITHOUT FURTHER VERIFICATION, NOR DO SUCH RESULTS CONSTITUTE A LEGAL OPINION. Acceptance of the results of the Whois constitutes acceptance of these terms, conditions and limitations. Whois data may be requested only for lawful purposes, in particular, to protect legal rights and obligations. Illegitimate uses of Whois data include, but are not limited to, unsolicited email, data mining, direct marketing or any other improper purpose. Any request made for Whois data will be documented by CiiA but will not be used for any commercial purpose whatsoever. NOTE: FAILURE TO LOCATE A RECORD IN THE WHOIS DATABASE IS NOT INDICATIVE OF THE AVAILABILITY OF A DOMAIN NAME.
+
+? 2000-2009 CiiA, All rights reserved.
+Domain Information
+Query: google.cx
+Status: Active
+Created: 30 Jul 2010
+Modified: 31 Jul 2010
+Expires: 30 Jul 2012
+Name Servers:
+ ns1.google.com
+ ns3.google.com
+ ns4.google.com
+ ns2.google.com
+
+Registrar Information
+Registrar Name: MarkMonitor
+Registration URL: http://www.markmonitor.com
+Address: MarkMonitor
+Emerald Tech Center
+391 N. Ancestor Place
+Boise, ID 83704
+Country: US
+Phone: +1 (208) 389-5740
+Fax: +1 (208) 389-5771
+Customer Service Contact: ccops@markmonitor.com
+Customer Service Email: ccops@markmonitor.com
+
+
+
+
+Registrant:
+Name: DNS Admin
+Organisation: Google Inc.
+Address:
+ 1600 Amphitheatre Parkway
+ Mountain View, CA 94043
+ US
+Email Address: dns-admin@google.com
+Phone Number: +1.6502530000
+Fax Number: +1.6506188571
+
+
+Admin Contact:
+Name: DNS Admin
+Organisation: Google Inc.
+Address:
+ 1600 Amphitheatre Parkway
+ Mountain View, CA 94043
+ US
+Email Address: dns-admin@google.com
+Phone Number: +1.6502530000
+Fax Number: +1.6506188571
+
+
+Technical Contact:
+Name: DNS Admin
+Organisation: Google Inc.
+Address:
+ 1600 Amphitheatre Parkway
+ Mountain View, CA 94043
+ US
+Email Address: dns-admin@google.com
+Phone Number: +1.6502530000
+Fax Number: +1.6506188571
+
@@ -0,0 +1,8 @@
+#status
+ should: %s == :registered
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == true
@@ -0,0 +1,51 @@
+TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by Christmas Island Internet Administration Limited ("CiiA").
+
+CiiA makes every effort to maintain the completeness and accuracy of the Whois data, but cannot guarantee that the results are error-free. Therefore, any data provided through the Whois service are on an "as is" basis without any warranties. BY USING THE WHOIS SERVICE AND THE DATA CONTAINED HEREIN OR IN ANY REPORT GENERATED WITH RESPECT THERETO, IT IS ACCEPTED THAT CIIA IS NOT LIABLE FOR ANY DAMAGES OF ANY KIND ARISING OUT OF, OR IN CONNECTION WITH, THE REPORT OR THE INFORMATION PROVIDED BY THE WHOIS SERVICE, NOR OMISSIONS OR MISSING INFORMATION. THE RESULTS OF ANY WHOIS REPORT OR INFORMATION PROVIDED BY THE WHOIS SERVICE CANNOT BE RELIED UPON IN CONTEMPLATION OF LEGAL PROCEEDINGS WITHOUT FURTHER VERIFICATION, NOR DO SUCH RESULTS CONSTITUTE A LEGAL OPINION. Acceptance of the results of the Whois constitutes acceptance of these terms, conditions and limitations. Whois data may be requested only for lawful purposes, in particular, to protect legal rights and obligations. Illegitimate uses of Whois data include, but are not limited to, unsolicited email, data mining, direct marketing or any other improper purpose. Any request made for Whois data will be documented by CiiA but will not be used for any commercial purpose whatsoever. NOTE: FAILURE TO LOCATE A RECORD IN THE WHOIS DATABASE IS NOT INDICATIVE OF THE AVAILABILITY OF A DOMAIN NAME.
+
+? 2000-2009 CiiA, All rights reserved.
+Domain Information
+Query: am.cx
+Status: Delegated
+Created: 17 Apr 2003
+Modified: 20 Apr 2010
+Expires: 17 Apr 2011
+Name Servers:
+ dns1.inet2.it
+ dns3.inet2.it
+ dns2.inet2.it
+
+Registrar Information
+Registrar Name: Indian Ocean Territories Telecom
+Registration URL: http://www.domains.cx
+Address: Indian Ocean Territories Telecom Pty Ltd
+Christmas Island Technology Centre
+Nursery Road, Drumsite
+Christmas Island
+Indian Ocean, WA 6798
+Country: CX
+Phone: +61 8 9164 8064
+Fax: +61 8 9164 8065
+Customer Service Contact: helpdesk@iott.cx
+Customer Service Email: helpdesk@iott.cx
+
+
+
+
+Registrant:
+Name: Andrea Mistrali
+Address:
+ Piazza Borgo Pila, 39
+ Genova 16122
+ IT
+Email Address: unknown
+
+
+Technical Contact:
+Name: Andrea Mistrali
+Address:
+ Piazza Borgo Pila, 39
+ Genoa I-16129
+ IT
+Email Address: am@am.cx
+Phone Number: +393480116805 ext. 3
+
@@ -0,0 +1,8 @@
+#status
+ should: %s == :available
+
+#available?
+ should: %s == true
+
+#registered?
+ should: %s == false
@@ -0,0 +1,11 @@
+TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by Christmas Island Internet Administration Limited ("CiiA").
+
+CiiA makes every effort to maintain the completeness and accuracy of the Whois data, but cannot guarantee that the results are error-free. Therefore, any data provided through the Whois service are on an "as is" basis without any warranties. BY USING THE WHOIS SERVICE AND THE DATA CONTAINED HEREIN OR IN ANY REPORT GENERATED WITH RESPECT THERETO, IT IS ACCEPTED THAT CIIA IS NOT LIABLE FOR ANY DAMAGES OF ANY KIND ARISING OUT OF, OR IN CONNECTION WITH, THE REPORT OR THE INFORMATION PROVIDED BY THE WHOIS SERVICE, NOR OMISSIONS OR MISSING INFORMATION. THE RESULTS OF ANY WHOIS REPORT OR INFORMATION PROVIDED BY THE WHOIS SERVICE CANNOT BE RELIED UPON IN CONTEMPLATION OF LEGAL PROCEEDINGS WITHOUT FURTHER VERIFICATION, NOR DO SUCH RESULTS CONSTITUTE A LEGAL OPINION. Acceptance of the results of the Whois constitutes acceptance of these terms, conditions and limitations. Whois data may be requested only for lawful purposes, in particular, to protect legal rights and obligations. Illegitimate uses of Whois data include, but are not limited to, unsolicited email, data mining, direct marketing or any other improper purpose. Any request made for Whois data will be documented by CiiA but will not be used for any commercial purpose whatsoever. NOTE: FAILURE TO LOCATE A RECORD IN THE WHOIS DATABASE IS NOT INDICATIVE OF THE AVAILABILITY OF A DOMAIN NAME.
+
+? 2000-2009 CiiA, All rights reserved.
+Domain Information
+Query: u34jedzcq.cx
+Status: Not Registered
+
+
+
@@ -0,0 +1,39 @@
+# encoding: utf-8
+
+# This file is autogenerated. Do not edit it manually.
+# If you want change the content of this file, edit
+#
+# /spec/fixtures/responses/whois.nic.cx/property_status_active.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.cx.rb'
+
+describe Whois::Record::Parser::WhoisNicCx, "property_status_active.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.nic.cx/property_status_active.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ @parser = klass.new(part)
+ end
+
+ describe "#status" do
+ it do
+ @parser.status.should == :registered
+ end
+ end
+ describe "#available?" do
+ it do
+ @parser.available?.should == false
+ end
+ end
+ describe "#registered?" do
+ it do
+ @parser.registered?.should == true
+ end
+ end
+end
@@ -0,0 +1,39 @@
+# encoding: utf-8
+
+# This file is autogenerated. Do not edit it manually.
+# If you want change the content of this file, edit
+#
+# /spec/fixtures/responses/whois.nic.cx/property_status_delegated.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.cx.rb'
+
+describe Whois::Record::Parser::WhoisNicCx, "property_status_delegated.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.nic.cx/property_status_delegated.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ @parser = klass.new(part)
+ end
+
+ describe "#status" do
+ it do
+ @parser.status.should == :registered
+ end
+ end
+ describe "#available?" do
+ it do
+ @parser.available?.should == false
+ end
+ end
+ describe "#registered?" do
+ it do
+ @parser.registered?.should == true
+ end
+ end
+end
@@ -0,0 +1,39 @@
+# encoding: utf-8
+
+# This file is autogenerated. Do not edit it manually.
+# If you want change the content of this file, edit
+#
+# /spec/fixtures/responses/whois.nic.cx/property_status_not_registered.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.cx.rb'
+
+describe Whois::Record::Parser::WhoisNicCx, "property_status_not_registered.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.nic.cx/property_status_not_registered.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ @parser = klass.new(part)
+ end
+
+ describe "#status" do
+ it do
+ @parser.status.should == :available
+ end
+ end
+ describe "#available?" do
+ it do
+ @parser.available?.should == true
+ end
+ end
+ describe "#registered?" do
+ it do
+ @parser.registered?.should == false
+ end
+ end
+end

0 comments on commit 8990f54

Please sign in to comment.