Skip to content

Commit

Permalink
Merge pull request #2 from gadelavega/master
Browse files Browse the repository at this point in the history
Date and time
  • Loading branch information
dlt committed Mar 28, 2012
2 parents 56e9409 + e065a50 commit 85b1b74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/yahoo_weatherman/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions spec/yahoo_weatherman/response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.