-
-
Save peternixey/1647211 to your computer and use it in GitHub Desktop.
Some changes I made to the vanilla Rails / Spork / RSpec setup to ensure models get reloaded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make sure your rspec block has the cli => drb line: | |
guard 'rspec', :cli => "--drb", :version => 2 do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YourApp::Application.configure do | |
... | |
config.cache_classes = false | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "spork" | |
gem 'guard-spork' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'guard' | |
gem 'guard-rspec' | |
# required for notifications via growl | |
gem 'ruby_gntp' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard 'rspec', :cli => "--drb", :version => 2 do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change this: | |
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, | |
:rspec_env => { 'RAILS_ENV' => 'test' } do | |
# to this: | |
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, | |
:rspec_env => { 'RAILS_ENV' => 'test' }, | |
:cli => "--drb" do | |
# ... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------- How your guardfile will look initially | |
guard 'rspec', :version => 2 do | |
... | |
end | |
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, | |
:rspec_env => { 'RAILS_ENV' => 'test' } do | |
... | |
end | |
# ---- How your guardfile SHOULD look | |
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, | |
:rspec_env => { 'RAILS_ENV' => 'test' } do | |
... | |
end | |
guard 'rspec', :version => 2 do | |
... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec helper file | |
... | |
Spork.prefork do | |
... | |
# add this line to the prefork block - helps avoid crashes (as well as reloading routes) | |
Spork.trap_method(Rails::Application::RoutesReloader, :reload!) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YourApp::Application.configure do | |
... | |
config.cache_classes = false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment