No notification when guard-rspec is used with spork

怎甘沉沦 提交于 2019-12-06 04:06:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!