Guest User

Untitled

a guest
Feb 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.51 KB | None | 0 0
  1. begin
  2.   require 'spork'
  3. rescue LoadError
  4.   module Spork
  5.     def self.prefork
  6.       yield
  7.     end
  8.  
  9.     def self.each_run
  10.       yield
  11.     end
  12.   end
  13. end
  14.  
  15. Spork.prefork do
  16.   # Loading more in this block will cause your tests to run faster. However,
  17.   # if you change any configuration or code from libraries loaded here, you'll
  18.   # need to restart spork for it take effect.
  19.  
  20.   # Configure Rails Envinronment
  21.   ENV['RAILS_ENV'] = 'test'
  22.  
  23.   require File.expand_path('../dummy/config/environment.rb',  __FILE__)
  24.   require 'rails/test_help'
  25.   require 'rspec/rails'
  26.   require 'shoulda-matchers'
  27.  
  28.   ActionMailer::Base.delivery_method = :test
  29.   ActionMailer::Base.perform_deliveries = true
  30.   ActionMailer::Base.default_url_options[:host] = 'test.com'
  31.  
  32.   Rails.backtrace_cleaner.remove_silencers!
  33.  
  34.   # Configure capybara for integration testing
  35.   require 'capybara/rails'
  36.   Capybara.default_driver   = :rack_test
  37.   Capybara.default_selector = :css
  38.  
  39.   # Run any available migration
  40.   # ActiveRecord::Migrator.migrate File.expand_path('../dummy/db/migrate/', __FILE__)
  41.  
  42.   # Load support files
  43.   Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
  44.  
  45.   RSpec.configure do |config|
  46.     # Remove this line if you don't want RSpec's should and should_not
  47.     # methods or matchers
  48.     #require 'rspec/expectations'
  49.     config.include RSpec::Matchers
  50.  
  51.     # == Mock Framework
  52.     config.mock_with :rspec
  53.   end
  54. end
  55.  
  56. Spork.each_run do
  57.   # This code will be run each time you run your specs.
  58. end
Add Comment
Please, Sign In to add comment