From 8aabca54fdc379b06120756a2466ce49ed4998b7 Mon Sep 17 00:00:00 2001 From: John Nunemaker Date: Sat, 17 Sep 2011 09:50:26 -0400 Subject: [PATCH] Tests passing again and updated gemfile with necessary gems. --- Gemfile | 5 +++++ Gemfile.lock | 10 ++++++++-- google-weather.gemspec | 1 - test/google_weather_test.rb | 2 +- test/test_helper.rb | 4 ++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index c4165ab..fdc350f 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,8 @@ source :rubygems # Specify your gem's dependencies in google-weather.gemspec gemspec + +gem 'rake' +gem 'shoulda' +gem 'jnunemaker-matchy', :require => 'matchy' +gem 'fakeweb' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 9c41fe6..2dfec67 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,13 +8,19 @@ GEM remote: http://rubygems.org/ specs: crack (0.1.6) + fakeweb (1.3.0) httparty (0.5.2) crack (= 0.1.6) + jnunemaker-matchy (0.4.0) + rake (0.9.2) + shoulda (2.11.3) PLATFORMS ruby DEPENDENCIES - bundler (>= 1.0.0) + fakeweb google-weather! - httparty (= 0.5.2) + jnunemaker-matchy + rake + shoulda diff --git a/google-weather.gemspec b/google-weather.gemspec index 77b54ee..12e004c 100644 --- a/google-weather.gemspec +++ b/google-weather.gemspec @@ -14,7 +14,6 @@ Gem::Specification.new do |s| s.required_rubygems_version = ">= 1.3.6" s.rubyforge_project = "google-weather" - s.add_development_dependency "bundler", ">= 1.0.0" s.add_dependency "httparty", "0.5.2" s.files = `git ls-files`.split("\n") diff --git a/test/google_weather_test.rb b/test/google_weather_test.rb index f7a3cc3..de26cbe 100644 --- a/test/google_weather_test.rb +++ b/test/google_weather_test.rb @@ -26,7 +26,7 @@ class GoogleWeatherTest < Test::Unit::TestCase context "Fetching" do setup do - FakeWeb.register_uri(:get, "http://www.google.com/ig/api?weather=46544", :string => File.read("fixtures/46544.xml")) + FakeWeb.register_uri(:get, "http://www.google.com/ig/api?weather=46544", :body => fixture_file("fixtures/46544.xml")) @weather = GoogleWeather.new(46544) end diff --git a/test/test_helper.rb b/test/test_helper.rb index 2764964..3a26a30 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,4 @@ +require 'pathname' require 'rubygems' require 'test/unit' require 'shoulda' @@ -11,4 +12,7 @@ require 'google_weather' class Test::Unit::TestCase + def fixture_file(path) + Pathname(__FILE__).dirname.join(*path.split('/')).read + end end