问题
I am working on ubuntu machine with Ruby-1.9.2 and rails-3.1.3. I am using guard-rspec for autotesting and spork as DRB server.
When I run guard without spork, it shows the correct notifications. But guard with spork shows no notifications at all.
Here is relevant part of my Gemfile
group :test, :development do
gem 'rake', '0.9.3.beta.1'
gem 'turn'
gem 'rspec-rails'
gem 'rspec'
gem 'guard-rspec'
gem 'spork'
gem 'webrat'
gem 'rb-fchange'
gem 'rb-fsevent'
gem 'libnotify'
end
回答1:
I know it is an old question, but found via Google and just struggle with same problem.
Solution is quite easy.
Use guard-spork (https://github.com/guard/guard-spork)
gem 'guard-rspec'
gem 'guard-spork'
gem 'libnotify'
Add at the top of Guardfile (before rspec definition):
guard 'spork' 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') { :rspec }
watch('test/test_helper.rb') { :test_unit }
watch(%r{features/support/}) { :cucumber }
end
run
bundle exec guard
来源:https://stackoverflow.com/questions/8633229/no-notification-when-guard-rspec-is-used-with-spork