Skip to content

Commit

Permalink
Use Time.parse - remove timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
rorymckinley committed Nov 4, 2012
1 parent 6f3c6a8 commit 2f128c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lib/whois/record/parser/whois.registry.net.za.rb
Expand Up @@ -92,10 +92,7 @@ def registrant_address_details
end

def parse_date(date_string)
if date_string
date_parts = date_string.split("-")
Time.new(*date_parts,nil,nil,nil,"+02:00")
end
Time.parse(date_string) if date_string
end

end
Expand Down
Expand Up @@ -34,13 +34,13 @@
should: %s == "broccoliwafflesareawesome.co.za"

#created_on
should: %s == Time.new(2012,3,27,nil,nil,nil,"+02:00")
should: %s == Time.parse("2012-03-27")

#status
should: %s == ['ok', 'autorenew']

#expires_on
should: %s == Time.new(2013,3,27,nil,nil,nil,"+02:00")
should: %s == Time.parse("2013-03-27")

#disclaimer
should: %s == "The use of this Whois facility is subject to the following terms and\nconditions. https://registry.net.za/whois_terms\nCopyright (c) UniForum SA 1995-2012\n"
Expand Down
Expand Up @@ -70,7 +70,7 @@
end
describe "#created_on" do
it do
subject.created_on.should == Time.new(2012,3,27,nil,nil,nil,"+02:00")
subject.created_on.should == Time.parse("2012-03-27")
end
end
describe "#status" do
Expand All @@ -80,7 +80,7 @@
end
describe "#expires_on" do
it do
subject.expires_on.should == Time.new(2013,3,27,nil,nil,nil,"+02:00")
subject.expires_on.should == Time.parse("2013-03-27")
end
end
describe "#disclaimer" do
Expand Down

0 comments on commit 2f128c6

Please sign in to comment.