Skip to content

Commit

Permalink
Merge pull request #194 from ATimofeev/master
Browse files Browse the repository at this point in the history
Tests update for whois.thnic.co.th
  • Loading branch information
weppos committed Dec 9, 2012
2 parents 3e61346 + d6637f7 commit 0d4c8f3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 25 deletions.
8 changes: 4 additions & 4 deletions lib/whois/record/parser/whois.thnic.co.th.rb
Expand Up @@ -41,7 +41,7 @@ class WhoisThnicCoTh < Base
end

property_supported :available? do
!!(content_for_scanner =~ /^% No entries found for the selected source/)
!!(content_for_scanner =~ /^% No match for/)
end

property_supported :registered? do
Expand All @@ -50,19 +50,19 @@ class WhoisThnicCoTh < Base


property_supported :created_on do
if content_for_scanner =~ /^Created Date: (.+?)\n/
if content_for_scanner =~ /^Created date: (.+?)\n/
Time.parse($1)
end
end

property_supported :updated_on do
if content_for_scanner =~ /^Updated Date: (.+?)\n/
if content_for_scanner =~ /^Updated date: (.+?)\n/
Time.parse($1)
end
end

property_supported :expires_on do
if content_for_scanner =~ /^Exp Date: (.+?)\n/
if content_for_scanner =~ /^Exp date: (.+?)\n/
Time.parse($1)
end
end
Expand Down
@@ -1,5 +1,4 @@

Whois Server Version 1.5

% No entries found for the selected source(s).
Whois Server Version 2.1.0

% No match for "U34JEDZCQ.CO.TH".
Expand Up @@ -14,11 +14,11 @@

#updated_on
should: %s CLASS(time)
should: %s == Time.parse("2010-09-23")
should: %s == Time.parse("2012-09-07")

#expires_on
should: %s CLASS(time)
should: %s == Time.parse("2011-10-07")
should: %s == Time.parse("2013-10-07")


#nameservers
Expand Down
25 changes: 11 additions & 14 deletions spec/fixtures/responses/whois.thnic.co.th/status_registered.txt
@@ -1,27 +1,24 @@

Whois Server Version 1.5
Whois Server Version 2.1.0

Domain: GOOGLE.CO.TH
ACE: GOOGLE.CO.TH
Registrar: T.H.NIC Co., Ltd.
Name Server: NS1.GOOGLE.COM
Name Server: NS2.GOOGLE.COM
Name Server: NS3.GOOGLE.COM
Name Server: NS4.GOOGLE.COM
Status: ACTIVE
Updated Date: 23 Sep 2010
Created Date: 8 Oct 2004
Renew Date: 8 Oct 2010
Exp Date: 7 Oct 2011
Updated date: 7 Sep 2012
Created date: 8 Oct 2004
Renew date: 8 Oct 2012
Exp date: 7 Oct 2013
Domain Holder: Google Inc.
2400 Bayshore Parkway, Mountain Veiw, CA
94043
US

Tech Contact: 81878
Google Inc.
1600 Amphitheatre Parkway,Building 41, Mountain View,CA 94043, U.S.A., California
2400 Bayshore Parkway, Mountain Veiw, CA
94043
US


Tech Contact: 13244
MarkMonitor Inc.
391 N Ancestor Place, Boise, ID
83704
US
Expand Up @@ -45,13 +45,13 @@
describe "#updated_on" do
it do
subject.updated_on.should be_a(Time)
subject.updated_on.should == Time.parse("2010-09-23")
subject.updated_on.should == Time.parse("2012-09-07")
end
end
describe "#expires_on" do
it do
subject.expires_on.should be_a(Time)
subject.expires_on.should == Time.parse("2011-10-07")
subject.expires_on.should == Time.parse("2013-10-07")
end
end
describe "#nameservers" do
Expand Down

0 comments on commit 0d4c8f3

Please sign in to comment.