Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update whois.nic.gl testcases. The new format is backward–compatible …

…with existing parser.
  • Loading branch information...
commit ee3959fd819ef5bee07d5770e85da09681ded7bd 1 parent 12ca341
Simone Carletti authored
4 lib/whois/answer/parser/whois.nic.gl.rb
View
@@ -44,11 +44,11 @@ class WhoisNicGl < Base
end
property_supported :available? do
- @available ||= (status == :available)
+ @available ||= (status == :available)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
9 test/testcases/responses/whois.nic.gl/available.txt
View
@@ -13,11 +13,10 @@ or facsimile; or (2) enable high volume, automated, electronic processes
that apply to Tele Greenland or its computer systems.
The compilation, repackaging, dissemination or other use of this Data is
-expressly prohibited.
-
-This service is rate limited, if you feel you have legitimate reasons for
-extended usage, please contact gl-admin@tele.gl.
-
+expressly prohibited.
Domain Information
Query: u34jedzcq.gl
Status: Not Registered
+
+
+
41 test/testcases/responses/whois.nic.gl/registered.txt
View
@@ -13,28 +13,35 @@ or facsimile; or (2) enable high volume, automated, electronic processes
that apply to Tele Greenland or its computer systems.
The compilation, repackaging, dissemination or other use of this Data is
-expressly prohibited.
-
-This service is rate limited, if you feel you have legitimate reasons for
-extended usage, please contact gl-admin@tele.gl.
-
+expressly prohibited.
Domain Information
Query: google.gl
-Created: 11 Mar 2003
-Expires: 01 Jan 2010
-Modified: 08 Nov 2009
Status: Active
-Registrar: markmonitor
+Created: 11 Mar 2003
+Modified: 19 Mar 2010
+Expires: 01 Jan 2011
Name Servers:
ns1.google.com
ns2.google.com
-Registrant:
- DNS Admin
- Google Inc.
- 1600 Amphitheatre Parkway
- Mountain ViewCA 94043
- US
- Voice: +1 6303300100
- Fax: +1 6506188571
+Registrar Information
+Registrar Name: MarkMonitor
+Registration URL: www.markmonitor.com
+Address: 391 N Ancestor Place
+Boise, ID 83704 US
+Country: US
+Customer Service Contact: Matt Serlin
+Customer Service Email: ccops AT markmonitor DOT com
+
+
+
+
+Registrant:
+Name: Google Inc.
+Address:
+ 1600 Amphitheatre Parkway
+ Mountain View, CA 94043
+ US
+Email Address: dns-admin AT google DOT com
+Phone Number: +1 6303300100
39 test/whois/answer/parser/whois.nic.gl_test.rb
View
@@ -10,20 +10,39 @@ def setup
def test_status
- assert_equal :registered,
- @klass.new(load_part('/registered.txt')).status
- assert_equal :available,
- @klass.new(load_part('/available.txt')).status
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = :registered
+ assert_equal expected, parser.status
+ assert_equal expected, parser.instance_eval { @status }
+
+ parser = @klass.new(load_part('/available.txt'))
+ expected = :available
+ 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
@@ -35,14 +54,14 @@ def test_created_on
end
def test_updated_on
- assert_equal Time.parse("2009-11-08"),
+ assert_equal Time.parse("2010-03-19"),
@klass.new(load_part('/registered.txt')).updated_on
assert_equal nil,
@klass.new(load_part('/available.txt')).updated_on
end
def test_expires_on
- assert_equal Time.parse("2010-01-01"),
+ assert_equal Time.parse("2011-01-01"),
@klass.new(load_part('/registered.txt')).expires_on
assert_equal nil,
@klass.new(load_part('/available.txt')).expires_on
Please sign in to comment.
Something went wrong with that request. Please try again.