Browse files

whois.cira.ca parser must support "to be released" status.

  • Loading branch information...
1 parent e5be4e1 commit 891675e25f965a6871e365b4f254c59d5635a6be @weppos committed Mar 1, 2011
View
2 CHANGELOG.rdoc
@@ -121,6 +121,8 @@
* FIXED: whois.nic.it parser doesn't set address state.
+* FIXED: whois.cira.ca parser must support "to be released" status.
+
=== BC
* Whois::Server::Adapters::Base#append_to_buffer renamed to buffer_append.
View
1 lib/whois/answer/parser/whois.cira.ca.rb
@@ -41,6 +41,7 @@ class WhoisCiraCa < Base
when "registered" then :registered
when "redemption" then :registered
when "auto-renew grace" then :registered
+ when "to be released" then :registered
when "available" then :available
# schema-1
when "exist" then :registered
View
8 spec/fixtures/responses/whois.cira.ca/schema-2/property_status_tobereleased.expected
@@ -0,0 +1,8 @@
+#status
+ should: %s == :registered
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == true
View
10 spec/fixtures/responses/whois.cira.ca/schema-2/property_status_tobereleased.txt
@@ -0,0 +1,10 @@
+Domain name: thomascraft.ca
+Domain status: to be released
+TBR Release date: 2011/03/02
+
+% WHOIS look-up made at 2011-03-01 21:56:25 (GMT)
+%
+% Use of CIRA's WHOIS service is governed by the Terms of Use in its Legal
+% Notice, available at http://www.cira.ca/legal-notice/?lang=en
+%
+% (c) 2010 Canadian Internet Registration Authority, (http://www.cira.ca/)
View
37 ...whois/answer/parser/responses/whois.cira.ca/schema-2/property_status_tobereleased_spec.rb
@@ -0,0 +1,37 @@
+# This file is autogenerated. Do not edit it manually.
+# If you want change the content of this file, edit
+#
+# /spec/whois/answer/parser/responses/whois.cira.ca/schema-2/property_status_tobereleased_spec.rb
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake genspec:parsers
+#
+
+require 'spec_helper'
+require 'whois/answer/parser/whois.cira.ca'
+
+describe Whois::Answer::Parser::WhoisCiraCa, "property_status_tobereleased.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.cira.ca/schema-2/property_status_tobereleased.txt")
+ part = Whois::Answer::Part.new(:body => File.read(file))
+ @parser = klass.new(part)
+ end
+
+ context "#status" do
+ it do
+ @parser.status.should == :registered
+ end
+ end
+ context "#available?" do
+ it do
+ @parser.available?.should == false
+ end
+ end
+ context "#registered?" do
+ it do
+ @parser.registered?.should == true
+ end
+ end
+end

0 comments on commit 891675e

Please sign in to comment.