Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

whois.ati.tn crashes when contact update is "None"

  • Loading branch information...
commit febbd29ac1e7853cfa0e8991cc5769b841038a25 1 parent 57439f7
@weppos authored
View
2  CHANGELOG.md
@@ -15,6 +15,8 @@
- FIXED: whois.nic.cx crashes when update date is empty.
+- FIXED: whois.ati.tn crashes when contact update is "None".
+
- CHANGED: Updated whois.nic.ec parser to the new response format.
- CHANGED: Updated whois.pandi.or.id parser to the new response format.
View
17 lib/whois/record/parser/whois.ati.tn.rb
@@ -99,15 +99,14 @@ class WhoisAtiTn < Base
def build_contact(element, type)
node("#{element} Name") do
Record::Contact.new(
- :type => type,
- :id => nil,
- :name => node("#{element} Name"),
- :address => node("#{element} Address"),
- :phone => node("#{element} Tel"),
- :fax => node("#{element} Fax"),
- :email => node("#{element} Email"),
- :created_on => node("#{element} Created") { |value| Time.parse(value) },
- :updated_on => node("#{element} Updated") { |value| Time.parse(value) }
+ type: type,
+ name: node("#{element} Name"),
+ address: node("#{element} Address"),
+ phone: node("#{element} Tel"),
+ fax: node("#{element} Fax"),
+ email: node("#{element} Email"),
+ created_on: node("#{element} Created") { |value| Time.parse(value) },
+ updated_on: node("#{element} Updated") { |value| Time.parse(value) if value != "None" }
)
end
end
View
8 spec/fixtures/responses/whois.ati.tn/property_contact_updated_none.expected
@@ -0,0 +1,8 @@
+#registrant_contacts
+ %s %CLASS{array}
+ %s %SIZE{1}
+ %s[0] %CLASS{contact}
+ %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT
+ %s[0].name == "MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh"
+ %s[0].created_on %TIME{2013-12-13 20:00:57}
+ %s[0].updated_on == nil
View
34 spec/fixtures/responses/whois.ati.tn/property_contact_updated_none.txt
@@ -0,0 +1,34 @@
+All rights reserved.
+Copyright "Tunisian Internet Agency - http://whois.tn"
+
+Domain : equipements-pro.com.tn
+Acivated : 2013-12-13 22:15:08
+Registrar : I-HOSTERS
+
+NameServers : ns.steerbook.com. [91.121.103.174]
+NameServers : dns.steerbook.com. [46.105.59.229]
+
+Owner Name : MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh
+Owner Address : complexe commercial Boukris 2 rue Om Larayes
+Owner Tel : 98639096
+Owner Fax :
+Owner Email : mbh@tunet.tn
+Owner Created : 2013-12-13 20:00:57
+Owner Updated : None
+
+Admin. Name : MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh
+Admin. Address : complexe commercial Boukris 2 rue Om Larayes
+Admin. Tel : 98639096
+Admin. Fax :
+Admin. Email : mbh@tunet.tn
+Admin. Created : 2013-12-13 20:00:57
+Admin. Updated : None
+
+Tech. Name : MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh
+Tech. Address : complexe commercial Boukris 2 rue Om Larayes
+Tech. Tel : 98639096
+Tech. Fax :
+Tech. Email : mbh@tunet.tn
+Tech. Created : 2013-12-13 20:00:57
+Tech. Updated : None
+
View
35 spec/whois/record/parser/responses/whois.ati.tn/property_contact_updated_none_spec.rb
@@ -0,0 +1,35 @@
+# 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.ati.tn/property_contact_updated_none.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.ati.tn.rb'
+
+describe Whois::Record::Parser::WhoisAtiTn, "property_contact_updated_none.expected" do
+
+ subject do
+ file = fixture("responses", "whois.ati.tn/property_contact_updated_none.txt")
+ part = Whois::Record::Part.new(body: File.read(file))
+ described_class.new(part)
+ end
+
+ describe "#registrant_contacts" do
+ it do
+ expect(subject.registrant_contacts).to be_a(Array)
+ expect(subject.registrant_contacts).to have(1).items
+ expect(subject.registrant_contacts[0]).to be_a(Whois::Record::Contact)
+ expect(subject.registrant_contacts[0].type).to eq(Whois::Record::Contact::TYPE_REGISTRANT)
+ expect(subject.registrant_contacts[0].name).to eq("MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh")
+ expect(subject.registrant_contacts[0].created_on).to eq(Time.parse("2013-12-13 20:00:57"))
+ expect(subject.registrant_contacts[0].updated_on).to eq(nil)
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.