aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUģis Ozols <ugis.ozolss@gmail.com>2012-10-23 10:19:39 +0300
committerUģis Ozols <ugis.ozolss@gmail.com>2012-10-23 10:19:39 +0300
commit4d7d5a20ef7d6eaae40fb51d9408bf61e34bb4e8 (patch)
treed4a31368e90dfc2e96fe01abfdd4649c8ba8dfa4 /spec
parente86e94419357285839deb84e36768fd15a2b5221 (diff)
downloadrefinerycms-blog-4d7d5a20ef7d6eaae40fb51d9408bf61e34bb4e8.tar.gz
refinerycms-blog-4d7d5a20ef7d6eaae40fb51d9408bf61e34bb4e8.tar.bz2
refinerycms-blog-4d7d5a20ef7d6eaae40fb51d9408bf61e34bb4e8.zip
Remove spork.
Diffstat (limited to 'spec')
-rw-r--r--spec/spec_helper.rb66
1 files changed, 20 insertions, 46 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index a313bbb..4b29712 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,56 +1,30 @@
require 'rubygems'
-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 'factory_girl_rails'
+require 'rspec/rails'
+require 'capybara/rspec'
+require 'factory_girl_rails'
- 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
-end
-
-def each_run
- ActiveSupport::Dependencies.clear
-
- FactoryGirl.reload
-
- # 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
+# set javascript driver for capybara
+Capybara.javascript_driver = :selenium
- 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