spec/spec_helper.rb in attack-barometer-0.5.0 vs spec/spec_helper.rb in attack-barometer-0.6.0
- old
+ new
@@ -30,18 +30,20 @@
end
if keys["weather"]
WEATHER_PARTNER_KEY = keys["weather"]["partner"]
WEATHER_LICENSE_KEY = keys["weather"]["license"]
end
+ if keys["weather_bug"]
+ WEATHERBUG_CODE = keys["weather_bug"]["code"]
+ end
else
File.open(KEY_FILE, 'w') {|f| f << "google: geocode: YOUR_KEY_KERE" }
geocode_google_key_message
exit
end
-
#
# for geocoding
#
geo_url = "http://maps.google.com/maps/geo?"
FakeWeb.register_uri(:get,
@@ -145,17 +147,42 @@
:string => File.read(File.join(File.dirname(__FILE__),
'fixtures/formats/weather_id',
'90210.xml')
)
)
+ FakeWeb.register_uri(:get,
+ "http://xoap.weather.com:80/search/search?where=San%20Francisco%20%2C%20USA",
+ :string => File.read(File.join(File.dirname(__FILE__),
+ 'fixtures/formats/weather_id',
+ 'ksfo.xml')
+ )
+ )
#
# for yahoo.com searches
#
FakeWeb.register_uri(:get,
"http://weather.yahooapis.com:80/forecastrss?p=USGA0028",
:string => File.read(File.join(File.dirname(__FILE__),
'fixtures/formats/weather_id',
'from_USGA0028.xml')
+ )
+ )
+
+ #
+ # For wunderground weather
+ #
+ FakeWeb.register_uri(:get,
+ "http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=51.055149%2C-114.062438",
+ :string => File.read(File.join(File.dirname(__FILE__),
+ 'fixtures/services/wunderground',
+ 'current_calgary_ab.xml')
+ )
+ )
+ FakeWeb.register_uri(:get,
+ "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=51.055149%2C-114.062438",
+ :string => File.read(File.join(File.dirname(__FILE__),
+ 'fixtures/services/wunderground',
+ 'forecast_calgary_ab.xml')
)
)
Spec::Runner.configure do |config|