Skip to content

Commit

Permalink
fix url and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoni authored and Yoni committed May 22, 2016
1 parent 8bf4f4d commit 1fb5578
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
9 changes: 7 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
PATH
remote: .
specs:
yahoo_weatherman (1.1.5)
yahoo_weatherman (2.0.0)
nokogiri

GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.1.3)
fakeweb (1.3.0)
nokogiri (1.5.5)
mini_portile2 (2.0.0)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
rspec (2.11.0)
rspec-core (~> 2.11.0)
rspec-expectations (~> 2.11.0)
Expand All @@ -26,3 +28,6 @@ DEPENDENCIES
fakeweb
rspec
yahoo_weatherman!

BUNDLED WITH
1.12.3
10 changes: 5 additions & 5 deletions lib/yahoo_weatherman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
require 'yahoo_weatherman/response'

module Weatherman

VERSION = '2.0.0'

URI = 'http://weather.yahooapis.com/forecastrss'
VERSION = '2.0.1'

URI = 'http://xml.yahooapis.com/forecastrss'

# = Client
#
Expand All @@ -39,9 +39,9 @@ def initialize(options = {})
@options = options
@uri = options[:url] || URI
end

#
# Looks up weather by woeid.
# Looks up weather by woeid.
#
def lookup_by_woeid(woeid)
raw = get request_url(woeid)
Expand Down
14 changes: 7 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ def fahrenheight_fixture
end

FakeWeb.allow_net_connect = false
FakeWeb.register_uri(:get, "http://weather.yahooapis.com/forecastrss?w=455821&u=c", :body => celsius_fixture)
FakeWeb.register_uri(:get, "http://weather.yahooapis.com/forecastrss?w=455821&u=f", :body => fahrenheight_fixture)
FakeWeb.register_uri(:get, "http://weather.yahooapis.com/forecastrss?w=123456&u=f", :body => celsius_fixture)
FakeWeb.register_uri(:get, "http://weather.yahooapis.com/forecastrss?w=4729347&u=c", :body => celsius_fixture)
FakeWeb.register_uri(:get, "http://weather.yahooapis.com/forecastrss?w=12786745&u=c", :body => celsius_fixture)
FakeWeb.register_uri(:get, "http://xml.yahooapis.com/forecastrss?w=455821&u=c", :body => celsius_fixture)
FakeWeb.register_uri(:get, "http://xml.yahooapis.com/forecastrss?w=455821&u=f", :body => fahrenheight_fixture)
FakeWeb.register_uri(:get, "http://xml.yahooapis.com/forecastrss?w=123456&u=f", :body => celsius_fixture)
FakeWeb.register_uri(:get, "http://xml.yahooapis.com/forecastrss?w=4729347&u=c", :body => celsius_fixture)
FakeWeb.register_uri(:get, "http://xml.yahooapis.com/forecastrss?w=12786745&u=c", :body => celsius_fixture)

module YAML
class << self

alias original_load load
def load(ignored_arg)
original_load(test_translation_file_stream)
end

def test_translation_file_stream
File.read(File.join(File.dirname(__FILE__), 'files', 'test_i18n.yml'))
File.read(File.join(File.dirname(__FILE__), 'files', 'test_i18n.yml'))
end

end
Expand Down

0 comments on commit 1fb5578

Please sign in to comment.