Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

whois.nic.it parser must support UNASSIGNABLE status.

  • Loading branch information...
commit 786a8eceb543ea7552c6fc90814fa4e67988a616 1 parent 9f30ca1
@weppos authored
View
2  CHANGELOG.rdoc
@@ -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
View
3  lib/whois/record/parser/whois.nic.it.rb
@@ -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
View
8 spec/fixtures/responses/whois.nic.it/property_status_unassignable.expected
@@ -0,0 +1,8 @@
+#status
+ should: %s == :reserved
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == false
View
2  spec/fixtures/responses/whois.nic.it/property_status_unassignable.txt
@@ -0,0 +1,2 @@
+Domain: la.it
+Status: UNASSIGNABLE
View
39 spec/whois/record/parser/responses/whois.nic.it/property_status_unassignable_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.