Quick Spork/RSpec Setup
-
Make sure RSpec is already running.
-
Add this in your Gemfile
# Gemfile
gem 'spork'
- In your project application root, create a .rspec file if its not already created and add –drb in the first line.
# .rspec
--drb
- 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
-
Reload Spork
-
Done!