Permalink
Browse files

Remove spork as a development dependency

Add spork to development & test group in Gemfile
Fix ControllerMacros and RequestMacros namespace in refinery support file
  • Loading branch information...
1 parent 45d8663 commit eca7a1a591abcae796aa4b8f168d9f313fdfffb0 Jamie Winsor committed Aug 11, 2011
Showing with 25 additions and 8 deletions.
  1. +7 −2 Gemfile
  2. +16 −4 spec/spec_helper.rb
  3. +2 −2 spec/support/refinery.rb
View
@@ -1,16 +1,21 @@
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'
# gem 'seo_meta', :git => 'git://github.com/parndt/seo_meta.git'
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
View
@@ -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 @@
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
View
@@ -3,6 +3,6 @@
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

0 comments on commit eca7a1a

Please sign in to comment.