David - Musings of an SRE

Quick Spork/RSpec Setup

  1. Make sure RSpec is already running.

  2. Add this in your Gemfile

# Gemfile
gem 'spork'
  1. In your project application root, create a .rspec file if its not already created and add –drb in the first line.
# .rspec
--drb
  1. Add Spork.prefork block into spec_helper.
# spec/spec_helper.rb
require 'spork'

Spork.prefork do
  ENV["RAILS_ENV"] ||= 'test'
  require File.expand_path("../../config/environment", __FILE__)
  require 'rspec/rails'
end
  1. Reload Spork

  2. Done!