Skip to content
Browse files

Remove spork.

  • Loading branch information...
1 parent 1aa8f2d commit 8d4c965b257af1ac02490e49a46d7f7b53da419f @ugisozols ugisozols committed Oct 23, 2012
Showing with 19 additions and 56 deletions.
  1. +0 −3 Gemfile
  2. +0 −8 Guardfile
  3. +19 −45 spec/spec_helper.rb
View
3 Gemfile
@@ -28,9 +28,6 @@ group :development, :test do
end
platforms :ruby do
- gem 'spork', '~> 0.9.0.rc'
- gem 'guard-spork'
-
unless ENV['TRAVIS']
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /darwin/i
View
8 Guardfile
@@ -10,11 +10,3 @@ guard 'rspec', :version => 2, :cli => "--color" do
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
-
-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')
-end
View
64 spec/spec_helper.rb
@@ -4,56 +4,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("../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.run_all_when_everything_filtered = true
- end
-
- # Set javascript driver for capybara
- Capybara.javascript_driver = :selenium
+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
-
- # 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
+# Set javascript driver for capybara
+Capybara.javascript_driver = :selenium
-# 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 8d4c965

Please sign in to comment.
Something went wrong with that request. Please try again.