Browse files

whois.nic.lk crashes when the creation date is 'null'.

  • Loading branch information...
1 parent a57fc35 commit 61cc35c3f123e7d92d584bcb0eb442fd58f5609e @weppos committed Nov 22, 2012
View
2 CHANGELOG.md
@@ -73,6 +73,8 @@
- FIXED: whois.nic.cz should support multiple status (GH-190).
+- FIXED: whois.nic.lk crashes when the creation date is 'null'.
+
### Backward Incompatibilities
View
2 lib/whois/record/parser/whois.nic.lk.rb
@@ -53,7 +53,7 @@ class WhoisNicLk < Base
property_supported :created_on do
if content_for_scanner =~ /Created on\.+:(.+)\n/
- Time.parse($1)
+ Time.parse($1) unless $1 == "null"
end
end
View
2 spec/fixtures/responses/whois.nic.lk/lk/property_created_on_null.expected
@@ -0,0 +1,2 @@
+#created_on
+ should: %s == nil
View
24 spec/fixtures/responses/whois.nic.lk/lk/property_created_on_null.txt
@@ -0,0 +1,24 @@
+
+
+This Service is Provided by the LK Domain Registry - Sri Lanka
+ Visit LK Domain at www.nic.lk
+ Contact Us at +94(0)112-4216061
+
+
+Registrant:
+ Nestle Lanka Ltd.
+Domain Name:
+ nestle.lk
+Cateogry:
+ CAT1
+
+
+Created on...............:null
+Expires on...............:2013-01-01
+Record last updated on...:2011-12-15
+
+Domain Servers in listed order:
+aoadns1.nestle.com.
+ctrdns1.nestle.com.
+ctrdns1.nestle.com.
+
View
29 spec/whois/record/parser/responses/whois.nic.lk/lk/property_created_on_null_spec.rb
@@ -0,0 +1,29 @@
+# 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.lk/lk/property_created_on_null.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.lk.rb'
+
+describe Whois::Record::Parser::WhoisNicLk, "property_created_on_null.expected" do
+
+ subject do
+ file = fixture("responses", "whois.nic.lk/lk/property_created_on_null.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ described_class.new(part)
+ end
+
+ describe "#created_on" do
+ it do
+ subject.created_on.should == nil
+ end
+ end
+end

0 comments on commit 61cc35c

Please sign in to comment.