Skip to content
Browse files

With some .me domains, whois.meregistry.net parser returns invalid va…

…lues for nameservers.
  • Loading branch information...
1 parent ee3959f commit cac78c25aa132b53381a6b8c840a2eddb721eebf @weppos committed Sep 2, 2010
View
2 CHANGELOG.rdoc
@@ -9,6 +9,8 @@
* FIXED: With some .mx domains, whois.nic.mx parser returns invalid values for nameservers.
+* FIXED: With some .me domains, whois.meregistry.net parser returns invalid values for nameservers.
+
== Release 1.3.2
View
6 lib/whois/answer/parser/whois.meregistry.net.rb
@@ -39,11 +39,11 @@ class WhoisMeregistryNet < Base
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "NOT FOUND")
+ @available ||= (content_for_scanner.strip == "NOT FOUND")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
@@ -67,7 +67,7 @@ class WhoisMeregistryNet < Base
property_supported :nameservers do
- @nameservers ||= content_for_scanner.scan(/Nameservers:([^ ]*?)\n/).flatten.map(&:downcase)
+ @nameservers ||= content_for_scanner.scan(/Nameservers:([^ ]+?)\n/).flatten.map(&:downcase)
end
end
View
95 test/testcases/responses/whois.meregistry.net/property_nameservers_is_missing.txt
@@ -0,0 +1,95 @@
+WHOIS TERMS & CONDITIONS: Access to .ME WHOIS information is provided to
+assist persons in determining the contents of a domain name registration
+record in the .ME registry database. The data in this record is provided by
+.ME Registry for informational purposes only, and .ME 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,
+facsimile, or other electronic processes 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,
+except as reasonably necessary to register domain names or modify existing
+registrations. All rights reserved. .ME Registry reserves the right to modify
+these terms at any time. By submitting this query, you agree to abide by this
+policy.
+
+Domain ID:D82062-ME
+Domain Name:WOSSNA.ME
+Domain Create Date:17-Jul-2008 15:54:20 UTC
+Domain Last Updated Date:16-Aug-2010 02:15:52 UTC
+Domain Expiration Date:17-Jul-2011 15:54:20 UTC
+Last Transferred Date:
+Trademark Name:
+Trademark Country:
+Trademark Number:
+Date Trademark Applied For:
+Date Trademark Registered:
+Sponsoring Registrar:Gandi SAS R114-ME (81)
+Created by:Gandi SAS R114-ME (81)
+Last Updated by Registrar:Gandi SAS R114-ME (81)
+Domain Status:CLIENT TRANSFER PROHIBITED
+Domain Status:INACTIVE
+Domain Status:PENDING DELETE
+Registrant ID:GM937-GANDI
+Registrant Name:Graeme Mathieson
+Registrant Organization:
+Registrant Address:12d Monktonhall Terrace
+Registrant Address2:
+Registrant Address3:
+Registrant City:Musselburgh
+Registrant State/Province:
+Registrant Country/Economy:GB
+Registrant Postal Code:EH21 6ER
+Registrant Phone:+44.7949077744
+Registrant Phone Ext.:
+Registrant FAX:
+Registrant FAX Ext.:
+Registrant E-mail:mathie@rubaidh.com
+Admin ID:GM2519-GANDI
+Admin Name:Graeme Mathieson
+Admin Organization:Rubaidh Ltd
+Admin Address:Stuart House
+Admin Address2:Eskmills
+Admin Address3:
+Admin City:Musselburgh
+Admin State/Province:
+Admin Country/Economy:GB
+Admin Postal Code:EH21 7PB
+Admin Phone:+44.1312735271
+Admin Phone Ext.:
+Admin FAX:
+Admin FAX Ext.:
+Admin E-mail:support@rubaidh.com
+Tech ID:GM2519-GANDI
+Tech Name:Graeme Mathieson
+Tech Organization:Rubaidh Ltd
+Tech Address:Stuart House
+Tech Address2:Eskmills
+Tech Address3:
+Tech City:Musselburgh
+Tech State/Province:
+Tech Country/Economy:GB
+Tech Postal Code:EH21 7PB
+Tech Phone:+44.1312735271
+Tech Phone Ext.:
+Tech FAX:
+Tech FAX Ext.:
+Tech E-mail:support@rubaidh.com
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+Nameservers:
+
+
View
42 test/whois/answer/parser/whois.meregistry.net_test.rb
@@ -10,20 +10,39 @@ def setup
def test_status
- assert_equal ["CLIENT DELETE PROHIBITED", "CLIENT TRANSFER PROHIBITED", "CLIENT UPDATE PROHIBITED"],
- @klass.new(load_part('/registered.txt')).status
- assert_equal [],
- @klass.new(load_part('/available.txt')).status
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = ["CLIENT DELETE PROHIBITED", "CLIENT TRANSFER PROHIBITED", "CLIENT UPDATE PROHIBITED"]
+ assert_equal expected, parser.status
+ assert_equal expected, parser.instance_eval { @status }
+
+ parser = @klass.new(load_part('/available.txt'))
+ expected = []
+ assert_equal expected, parser.status
+ assert_equal expected, parser.instance_eval { @status }
end
def test_available?
- assert !@klass.new(load_part('/registered.txt')).available?
- assert @klass.new(load_part('/available.txt')).available?
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = false
+ assert_equal expected, parser.available?
+ assert_equal expected, parser.instance_eval { @available }
+
+ parser = @klass.new(load_part('/available.txt'))
+ expected = true
+ assert_equal expected, parser.available?
+ assert_equal expected, parser.instance_eval { @available }
end
def test_registered?
- assert @klass.new(load_part('/registered.txt')).registered?
- assert !@klass.new(load_part('/available.txt')).registered?
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = true
+ assert_equal expected, parser.registered?
+ assert_equal expected, parser.instance_eval { @registered }
+
+ parser = @klass.new(load_part('/available.txt'))
+ expected = false
+ assert_equal expected, parser.registered?
+ assert_equal expected, parser.instance_eval { @registered }
end
@@ -61,4 +80,11 @@ def test_nameservers
assert_equal expected, parser.instance_eval { @nameservers }
end
+ def test_nameservers_are_missing
+ parser = @klass.new(load_part('/property_nameservers_is_missing.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end

0 comments on commit cac78c2

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