I am using guard-rspec with spring in my rails app. When I start guard and run tests, spring starts up fine. But when I exit from guard (by exit command in the console) guard exit, but it leaves spring running:
[1] guard(main)> exit
13:38:55 - INFO - Bye bye...
My guard file:
guard 'rspec', :spring => true do
watch(%r{^(.*)\.(rb|haml|erb|coffee)$}) { 'spec' }
end
Any help would be appreciated..thanks in advance.
Guard::Rspec doesn't come with some special spring handling and the latest version 4.0 even removes the spring
option in favor of the more common and thus flexible cmd
option. But since a Guardfile
is normal Ruby code, you can use at_exit
to stop spring if you like:
at_exit { `spring stop` }
guard 'rspec', cmd: 'spring rspec' do
watch(%r{^(.*)\.(rb|haml|erb|coffee)$}) { 'spec' }
end