Skip to content

Instantly share code, notes, and snippets.

@ajsharp
Created October 13, 2009 04:53
Show Gist options
  • Save ajsharp/209002 to your computer and use it in GitHub Desktop.
Save ajsharp/209002 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'spork'
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.
ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment"
require 'spec/autorun'
require 'spec/rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
Spec::Runner.configure do |config|
# If you're not using ActiveRecord you should remove these
# lines, delete config/database.yml and disable :active_record
# in your config/boot.rb
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
# == Mock Framework
#
# RSpec uses it's own mocking framework by default. If you prefer to
# use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
end
end
Spork.each_run do
# This code will be run each time you run your specs.
end
# --- Instructions ---
# - Sort through your spec_helper file. Place as much environment loading
# code that you don't normally modify during development in the
# Spork.prefork block.
# - Place the rest under Spork.each_run block
# - Any code that is left outside of the blocks will be ran during preforking
# and during each_run!
# - These instructions should self-destruct in 10 seconds. If they don't,
# feel free to delete them.
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment