Permalink
Browse files

Use Time.parse - remove timezone

  • Loading branch information...
1 parent 6f3c6a8 commit 2f128c6a76316665d0d7ca5e62a92c37594d9254 @rorymckinley committed Nov 4, 2012
@@ -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
@@ -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"
@@ -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
@@ -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

0 comments on commit 2f128c6

Please sign in to comment.