From eca7a1a591abcae796aa4b8f168d9f313fdfffb0 Mon Sep 17 00:00:00 2001 From: Jamie Winsor Date: Thu, 11 Aug 2011 03:08:12 -0700 Subject: Remove spork as a development dependency Add spork to development & test group in Gemfile Fix ControllerMacros and RequestMacros namespace in refinery support file --- spec/spec_helper.rb | 20 ++++++++++++++++---- spec/support/refinery.rb | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'spec') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8438536..75db576 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ require 'rubygems' -require 'spork' -Spork.prefork do +def setup_environment # Loading more in this block will cause your tests to run faster. However, # if you change any configuration or code from libraries loaded here, you'll # need to restart spork for it take effect. @@ -27,6 +26,19 @@ Spork.prefork do end end -Spork.each_run do - # This code will be run each time you run your specs. +def each_run +end + +# If spork is available in the Gemfile it'll be used but we don't force it. +unless (begin; require 'spork'; rescue LoadError; nil end).nil? + Spork.prefork do + setup_environment + end + + Spork.each_run do + each_run + end +else + setup_environment + each_run end diff --git a/spec/support/refinery.rb b/spec/support/refinery.rb index 2b180db..85d28ce 100644 --- a/spec/support/refinery.rb +++ b/spec/support/refinery.rb @@ -3,6 +3,6 @@ require 'refinery/testing/controller_macros' require 'refinery/testing/request_macros' RSpec.configure do |config| - config.extend Refinery::ControllerMacros::Authentication, :type => :controller - config.extend Refinery::RequestMacros::Authentication, :type => :request + config.extend Refinery::Testing::ControllerMacros::Authentication, :type => :controller + config.extend Refinery::Testing::RequestMacros::Authentication, :type => :request end -- cgit v1.2.3