From acb95ec1a8998e5a70600123056e2c9cfbe87e0b Mon Sep 17 00:00:00 2001 From: Sandro Turriate Date: Thu, 13 May 2010 21:48:42 -0400 Subject: [PATCH] Only disable net connections during the spec suite --- spec/spec_helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9d06f4b..deb1d7c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,8 +2,6 @@ require File.join(File.dirname(__FILE__), '..', 'lib', 'httparty') require 'spec/autorun' require 'fakeweb' -FakeWeb.allow_net_connect = false - def file_fixture(filename) open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename.to_s}")).read end @@ -12,4 +10,10 @@ Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].e Spec::Runner.configure do |config| config.include HTTParty::StubResponse + config.before(:suite) do + FakeWeb.allow_net_connect = false + end + config.after(:suite) do + FakeWeb.allow_net_connect = true + end end