spec/weather_spec.rb in attack-barometer-0.3.1 vs spec/weather_spec.rb in attack-barometer-0.3.2
- old
+ new
@@ -92,9 +92,21 @@
@weather.measurements << @wunderground
@weather.measurements << @yahoo
@weather.measurements << @google
end
+ it "doesn't include nil values" do
+ @weather.source(:wunderground).current.temperature = Barometer::Temperature.new
+ @weather.source(:wunderground).current.temperature.c = 10
+
+ @weather.temperature.c.should == 10
+
+ @weather.source(:yahoo).current.temperature = Barometer::Temperature.new
+ @weather.source(:yahoo).current.temperature.c = nil
+
+ @weather.temperature.c.should == 10
+ end
+
describe "for temperature" do
before(:each) do
@weather.source(:wunderground).current.temperature = Barometer::Temperature.new
@weather.source(:wunderground).current.temperature.c = 10
\ No newline at end of file