1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
require 'spec_helper'
require_relative './../../examples/current_weather'
describe Weather do
before do
@weather = Weather.from_xml(xml_for('current_weather'))
end
it "should extract observations" do
@weather.observation.should be_an_instance_of(WeatherObservation)
end
end
describe WeatherObservation do
before do
@observation = Weather.from_xml(xml_for('current_weather')).observation
end
it "should extract temperature" do
@observation.temperature.should > 0
end
it "should extract feels_like" do
@observation.feels_like.should > 0
end
describe "#current_condition" do
it "should extract current_condition" do
@observation.current_condition.should_not be_empty
end
it "should extract icon attribute" do
pending "need to think options through for HappyMapper-style :attributes extensions"
@observation.current_condition.icon.should_not be_empty
end
end
end
|