aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gemfile9
-rw-r--r--spec/spec_helper.rb20
-rw-r--r--spec/support/refinery.rb4
3 files changed, 25 insertions, 8 deletions
diff --git a/Gemfile b/Gemfile
index b445476..27048b3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,7 @@
source "http://rubygems.org"
+gemspec
+
## Uncomment the following lines to develop against a local clone of refinery
# gem 'refinerycms', :path => '~/Code/refinerycms'
# gem 'refinerycms-generators', :path => '~/Code/refinerycms-generators'
@@ -7,10 +9,13 @@ source "http://rubygems.org"
gem 'jquery-rails'
+group :development, :test do
+ gem 'spork', '0.9.0.rc9', :platforms => :ruby
+ gem 'guard-spork', :platforms => :ruby
+end
+
group :assets do
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-rails', "~> 3.1.0.rc"
gem 'uglifier'
end
-
-gemspec
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