diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec_helper.rb | 20 | ||||
-rw-r--r-- | spec/support/refinery.rb | 4 |
2 files changed, 18 insertions, 6 deletions
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 |