Permalink
Browse files

whois.nic.it parser must support UNASSIGNABLE status.

  • Loading branch information...
weppos committed Apr 6, 2011
1 parent 9f30ca1 commit 786a8eceb543ea7552c6fc90814fa4e67988a616
View
@@ -5,6 +5,8 @@
* CHANGED: whois.ripn.net now returns an array of contacts, one for each email (#89)
+* FIXED: whois.nic.it parser must support UNASSIGNABLE status.
+
== Release 2.0.1
@@ -49,6 +49,8 @@ class WhoisNicIt < Base
:registered
when "pendingdelete / redemptionperiod", "grace-period"
:registered
+ when "unassignable"
+ :reserved
when "available"
:available
else
@@ -61,6 +63,7 @@ class WhoisNicIt < Base
end
property_supported :registered? do
+ node("Status") != "UNASSIGNABLE" &&
!available?
end
@@ -0,0 +1,8 @@
+#status
+ should: %s == :reserved
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == false
@@ -0,0 +1,2 @@
+Domain: la.it
+Status: UNASSIGNABLE
@@ -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.it/property_status_unassignable.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake genspec:parsers
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.it.rb'
+
+describe Whois::Record::Parser::WhoisNicIt, "property_status_unassignable.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.nic.it/property_status_unassignable.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ @parser = klass.new(part)
+ end
+
+ context "#status" do
+ it do
+ @parser.status.should == :reserved
+ end
+ end
+ context "#available?" do
+ it do
+ @parser.available?.should == false
+ end
+ end
+ context "#registered?" do
+ it do
+ @parser.registered?.should == false
+ end
+ end
+end

0 comments on commit 786a8ec

Please sign in to comment.