Skip to content

Instantly share code, notes, and snippets.

@acnalesso
Last active December 15, 2015 04:29
Show Gist options
  • Save acnalesso/5202221 to your computer and use it in GitHub Desktop.
Save acnalesso/5202221 to your computer and use it in GitHub Desktop.
Spork to reload models when change is made, Using Guard, Spork, and RSpec
OS: Linux Debian Lenny
gem versions:
factory_girl_rails-4.2.1
spork-1.0.0rc3
guard-1.6.2
rails-3.2.9
rspec-rails-2.13.0
Gemfile:
group :test do
gem 'guard-rspec'
gem 'guard-spork'
gem 'spork-rails'
gem 'factory_girl_rails', :require => false
end
spec/spec_helper.rb
also removed require 'rubygems'(because we're using bundle'
Spork.each_run do
require 'factory_girl_rails'
FactoryGirl.reload
end
Guardfile:
guard 'rspec', :cli => '--drb --format Fuubar --color', :all_one_start => false, :all_afeter_pass => false do
#Rails example
watch(r%{^app/models/(.+)\.rb$}) { "spec/models" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment