Permalink
Browse files

Remove spork.

  • Loading branch information...
1 parent d73740f commit 8ebeeb740f2f2b718bab4e99d0d93bbe5f995c6b @ugisozols ugisozols committed Oct 21, 2012
View
@@ -42,9 +42,6 @@ group :development, :test do
end
platforms :ruby do
- gem 'spork', '~> 0.9.0'
- gem 'guard-spork', '~> 0.5.2'
-
unless ENV['TRAVIS']
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /darwin/i
View
@@ -7,19 +7,6 @@ extensions = (ENV['ENGINES'] && ENV['ENGINES'].to_s.split(',')) || %w(
resources
)
-guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
- watch('config/application.rb')
- watch('config/environment.rb')
- watch(%r{^config/environments/.+\.rb$})
- watch(%r{^config/initializers/.+\.rb$})
- watch('spec/spec_helper.rb')
- watch(%r{^spec/support/.+\.rb$})
-
- extensions.each do |extension|
- watch(%r{^#{extension}/spec/support/.+\.rb$})
- end
-end
-
guard 'rspec', :version => 2, :spec_paths => extensions.map{|e| "#{e}/spec"}, :cli => (['~/.rspec', '.rspec'].map{|f| File.read(File.expand_path(f)).split("\n").join(' ') if File.exists?(File.expand_path(f))}.join(' ')) do
extensions.each do |extension|
watch(%r{^#{extension}/spec/.+_spec\.rb$})
@@ -1,57 +1,35 @@
-def setup_environment
- # Configure Rails Environment
- ENV["RAILS_ENV"] ||= 'test'
-
- if File.exist?(dummy_path = File.expand_path('../dummy/config/environment.rb', __FILE__))
- require dummy_path
- elsif File.dirname(__FILE__) =~ %r{vendor/extensions}
- # Require the path to the refinerycms application this is vendored inside.
- require File.expand_path('../../../../../config/environment', __FILE__)
- else
- puts "Could not find a config/environment.rb file to require. Please specify this in #{File.expand_path(__FILE__)}"
- end
-
- require 'rspec/rails'
- require 'capybara/rspec'
-
- Rails.backtrace_cleaner.remove_silencers!
-
- RSpec.configure do |config|
- config.mock_with :rspec
- config.treat_symbols_as_metadata_keys_with_true_values = true
- config.filter_run :focus => true
- config.run_all_when_everything_filtered = true
- end
+# Configure Rails Environment
+ENV["RAILS_ENV"] ||= 'test'
+
+if File.exist?(dummy_path = File.expand_path('../dummy/config/environment.rb', __FILE__))
+ require dummy_path
+elsif File.dirname(__FILE__) =~ %r{vendor/extensions}
+ # Require the path to the refinerycms application this is vendored inside.
+ require File.expand_path('../../../../../config/environment', __FILE__)
+else
+ puts "Could not find a config/environment.rb file to require. Please specify this in #{File.expand_path(__FILE__)}"
end
-def each_run
- Rails.cache.clear
- ActiveSupport::Dependencies.clear
- FactoryGirl.reload
+require 'rspec/rails'
+require 'capybara/rspec'
+
+Rails.backtrace_cleaner.remove_silencers!
- # Requires supporting files with custom matchers and macros, etc,
- # in ./support/ and its subdirectories including factories.
- ([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
- Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
- }.flatten.sort.each do |support_file|
- require support_file
- end
+RSpec.configure do |config|
+ config.mock_with :rspec
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.filter_run :focus => true
+ config.run_all_when_everything_filtered = true
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
- # 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.
- setup_environment
- end
+Rails.cache.clear
+ActiveSupport::Dependencies.clear
+FactoryGirl.reload
- Spork.each_run do
- # This code will be run each time you run your specs.
- each_run
- end
-else
- setup_environment
- each_run
+# Requires supporting files with custom matchers and macros, etc,
+# in ./support/ and its subdirectories including factories.
+([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
+ Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
+}.flatten.sort.each do |support_file|
+ require support_file
end
View
@@ -4,55 +4,33 @@
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT)
-def setup_environment
- # Configure Rails Environment
- ENV["RAILS_ENV"] ||= 'test'
+# Configure Rails Environment
+ENV["RAILS_ENV"] ||= 'test'
- require File.expand_path("../dummy/config/environment", __FILE__)
+require File.expand_path("../dummy/config/environment", __FILE__)
- require 'rspec/rails'
- require 'capybara/rspec'
+require 'rspec/rails'
+require 'capybara/rspec'
- Rails.backtrace_cleaner.remove_silencers!
+Rails.backtrace_cleaner.remove_silencers!
- RSpec.configure do |config|
- config.mock_with :rspec
- config.treat_symbols_as_metadata_keys_with_true_values = true
- config.filter_run :focus => true
- config.filter_run :js => true if ENV['JS'] == 'true'
- config.filter_run :js => nil if ENV['JS'] == 'false'
- config.run_all_when_everything_filtered = true
- end
+RSpec.configure do |config|
+ config.mock_with :rspec
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.filter_run :focus => true
+ config.filter_run :js => true if ENV['JS'] == 'true'
+ config.filter_run :js => nil if ENV['JS'] == 'false'
+ config.run_all_when_everything_filtered = true
end
-def each_run
- Rails.cache.clear
- ActiveSupport::Dependencies.clear
- FactoryGirl.reload
-
- # Requires supporting files with custom matchers and macros, etc,
- # in ./support/ and its subdirectories including factories.
- ([ENGINE_RAILS_ROOT, Rails.root.to_s].uniq | Refinery::Plugins.registered.pathnames).map{|p|
- Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
- }.flatten.sort.each do |support_file|
- require support_file
- end
-end
+Rails.cache.clear
+ActiveSupport::Dependencies.clear
+FactoryGirl.reload
-# 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
- # 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.
- setup_environment
- end
-
- Spork.each_run do
- # This code will be run each time you run your specs.
- each_run
- end
-else
- setup_environment
- each_run
+# Requires supporting files with custom matchers and macros, etc,
+# in ./support/ and its subdirectories including factories.
+([ENGINE_RAILS_ROOT, Rails.root.to_s].uniq | Refinery::Plugins.registered.pathnames).map{|p|
+ Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
+}.flatten.sort.each do |support_file|
+ require support_file
end
@@ -1,52 +1,30 @@
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT)
-def setup_environment
- # Configure Rails Environment
- ENV["RAILS_ENV"] ||= 'test'
+# Configure Rails Environment
+ENV["RAILS_ENV"] ||= 'test'
- require File.expand_path("../../config/environment", __FILE__)
+require File.expand_path("../../config/environment", __FILE__)
- require 'rspec/rails'
- require 'capybara/rspec'
+require 'rspec/rails'
+require 'capybara/rspec'
- Rails.backtrace_cleaner.remove_silencers!
+Rails.backtrace_cleaner.remove_silencers!
- RSpec.configure do |config|
- config.mock_with :rspec
- config.treat_symbols_as_metadata_keys_with_true_values = true
- config.filter_run :focus => true
- config.run_all_when_everything_filtered = true
- end
+RSpec.configure do |config|
+ config.mock_with :rspec
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.filter_run :focus => true
+ config.run_all_when_everything_filtered = true
end
-def each_run
- Rails.cache.clear
- ActiveSupport::Dependencies.clear
- FactoryGirl.reload
+Rails.cache.clear
+ActiveSupport::Dependencies.clear
+FactoryGirl.reload
- # Requires supporting files with custom matchers and macros, etc,
- # in ./support/ and its subdirectories including factories.
- ([ENGINE_RAILS_ROOT, Rails.root.to_s].uniq | ::Refinery::Plugins.registered.pathnames).map{|p|
- Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
- }.flatten.sort.each do |support_file|
- require support_file
- end
-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
- # 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.
- setup_environment
- end
-
- Spork.each_run do
- # This code will be run each time you run your specs.
- each_run
- end
-else
- setup_environment
- each_run
+# Requires supporting files with custom matchers and macros, etc,
+# in ./support/ and its subdirectories including factories.
+([ENGINE_RAILS_ROOT, Rails.root.to_s].uniq | ::Refinery::Plugins.registered.pathnames).map{|p|
+ Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
+}.flatten.sort.each do |support_file|
+ require support_file
end

0 comments on commit 8ebeeb7

Please sign in to comment.