guard/guard — Issue #188: Guard quits after running Guard::RSpec
Author: subelsky
Created: 2011-12-06 16:32:57+00:00
State: open

I just setup a new project with guard 0.8.8, guard-rspec 0.5.8, spork 0.9.0.rc9, and guard-spork 0.3.2 on OS X Lion. Everything seems to work fine except "guard start" exits after running all the specs. Here's what the debug output looks like:

```
Guard is now watching at '/Users/subelsky/code/cardshark'
DEBUG (11:25:09): Hook :start_begin executed for Guard::Spork
DEBUG (11:25:09): Command execution: ps aux | awk '/spork/&&!/awk/{print $2;}'
DEBUG (11:25:09): Killing Spork servers with PID: 2279
DEBUG (11:25:09): Command execution: ps aux | awk '/spork/&&!/awk/{print $2;}'
DEBUG (11:25:09): Command execution: ps aux | awk '/spork/&&!/awk/{print $2;}'
Starting Spork for RSpec
DEBUG (11:25:09): Spawned Spork server 2427 ('bundle exec spork -p 9069')
DEBUG (11:25:09): Command execution: ps aux | awk '/spork/&&!/awk/{print $2;}'
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 9069!
Spork server for RSpec successfully started
DEBUG (11:25:20): Command execution: growlnotify --version
DEBUG (11:25:20): Hook :start_end executed for Guard::Spork
DEBUG (11:25:20): Hook :start_begin executed for Guard::RSpec
Guard::RSpec is running, with RSpec 2!
Running all specs
DEBUG (11:25:20): Command execution: rspec --help
DEBUG (11:25:20): Command execution: bundle exec rspec -f progress -r /Users/subelsky/.rvm/gems/ruby-1.9.2-p180-patched@global/gems/guard-rspec-0.5.8/lib/guard/rspec/formatters/notification_rspec.rb -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec
.**.

Pending:
adding a card as a signed-in user succeeds
# No reason given
# ./spec/integration/add_a_card_spec.rb:5
adding a card as a signed-out user
# Not Yet Implemented
# ./spec/integration/add_a_card_spec.rb:11

Finished in 8.09 seconds
4 examples, 0 failures, 2 pending
DEBUG (11:25:31): Hook :start_end executed for Guard::RSpec
ruby-1.9.2-p180@cardshark ~/code/cardshark$
```

My Guardfile is below:

```ruby
guard 'spork', :cucumber => false, :test_unit => false, :rspec => true, :rspec_port => 9069 do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb')
end

guard 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/integration/#{m[1]}_spec.rb" }
end
```

I've been googling and experiment for awhile, so I hope I didn't miss some obvious answer!