aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJamie Winsor <jamie@enmasse.com>2011-08-11 03:08:12 -0700
committerJamie Winsor <jamie@enmasse.com>2011-08-11 03:08:12 -0700
commiteca7a1a591abcae796aa4b8f168d9f313fdfffb0 (patch)
tree7ba5a9bb7223a732bc36c0d5b6deabe67db1661f /spec
parent45d8663de5a58740ac6bcf6c18a377aeb6fa0cd5 (diff)
downloadrefinerycms-blog-eca7a1a591abcae796aa4b8f168d9f313fdfffb0.tar.gz
refinerycms-blog-eca7a1a591abcae796aa4b8f168d9f313fdfffb0.tar.bz2
refinerycms-blog-eca7a1a591abcae796aa4b8f168d9f313fdfffb0.zip
Remove spork as a development dependency
Add spork to development & test group in Gemfile Fix ControllerMacros and RequestMacros namespace in refinery support file
Diffstat (limited to 'spec')
-rw-r--r--spec/spec_helper.rb20
-rw-r--r--spec/support/refinery.rb4
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