Permalink
Browse files

Merge pull request #2 from gadelavega/master

Date and time
  • Loading branch information...
dlt committed Mar 28, 2012
2 parents 56e9409 + e065a50 commit 85b1b741c146a6af3d136bdb566ff7e251a4c982
Showing with 4 additions and 3 deletions.
  1. +1 −1 lib/yahoo_weatherman/response.rb
  2. +3 −2 spec/yahoo_weatherman/response_spec.rb
@@ -190,7 +190,7 @@ def do_convertions(attributes, *pairs)
def convert(value, method)
return value unless method
- method == :to_date ? Date.parse(value) : value.send(method)
+ method == :to_date ? DateTime.parse(value) : value.send(method)
end
def translate!(attributes)
@@ -16,7 +16,7 @@
@response.condition['code'].should == 28
@response.condition['temp'].should == 28
@response.condition['text'].should == 'Mostly Cloudy'
- @response.condition['date'].should == Date.parse('Sat, 13 Mar 2010 11:00 pm LST')
+ @response.condition['date'].should == DateTime.parse('Sat, 13 Mar 2010 6:00 pm LST')
end
it 'should provide the units used' do
@@ -111,7 +111,8 @@
response.forecasts.first['high'].should == 75
response.forecasts.last['high'].should == 79
response.condition['temp'].should == 66
- end
+ response.condition['date'].should == DateTime.parse('Sat, 18 Mar 2010 12:00 am LST')
+ end
end
end

0 comments on commit 85b1b74

Please sign in to comment.