2012-01-10 19 views
3

我不知道爲什麼libnotify stoped顯示有關已完成測試的信息。 它顯示Spork消息:「Rspec成功啓動。」但之後並沒有顯示任何東西。我正在使用Ubuntu。爲什麼libnotify停止顯示Rspec通知?

guard 'spork', :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do 
    watch('config/application.rb') 
    watch('config/environment.rb') 
    watch(%r{^config/environments/.+\.rb$}) 
    watch(%r{^config/initializers/.+\.rb$}) 
    watch('spec/spec_helper.rb') 
    watch(%r{^spec/support/.+\.rb$}) 
end 

guard 'rspec', :version => 2, :cli => "--drb", :all_on_start => false, :all_after_pass => false do 
    watch(%r{^spec/.+_spec\.rb$}) 
    watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } 
    watch('spec/spec_helper.rb') { "spec" } 
    watch('spec/acceptance/acceptance_helper.rb') { "spec" } 
    watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{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('config/routes.rb') { "spec/routing" } 
    watch('app/controllers/application_controller.rb') { "spec/controllers" } 
    # Capybara request specs 
    watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" } 

    # watch(%r{^spec/support/(requests|controllers|mailers|models)_helpers\.rb}) { |m| "spec/#{m[1]}" } 
    # 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/requests/#{m[1]}_spec.rb"] } 
    watch(%r{^app/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" } 
end 

我spec_helper:***

當我初始化後衛:

Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/home/rege/.rvm/gems/ruby-1.9.2-p290/gems/guard-rspec-0.5.10/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]... 

如何診斷問題出在哪裏?

編輯:

解決方案:https://github.com/guard/guard-rspec/issues/90#issuecomment-3435651

回答

3

我有這個問題,以及與安裝在護叉勺(https://github.com/guard/guard-spork)寶石(它添加到我的rails Gemfile和bundle安裝)。然後,按照該頁面上的說明,我運行了'guard init spork',它爲您的Guardfile添加了一個'spork'部分,以查看您可以觀看的文件。

當我運行bundle exec守護程序時,它實際上確保spork也是開始和快死吧!我的測試文件更改正在運行,並將結果發佈到通知程序。爲了記錄,我使用Ubuntu 11.10 64bit與ruby rvm。我Gemfile中的相關寶石是gem'guard-rspec',gem'guard-spork',gem'rspec-rails',gem'watchr',寶石'spork',寶石'libnotify'。不確定是否全部都是相關的。

您可以在Hartl令人敬畏的Rails教程http://ruby.railstutorial.org/chapters/static-pages#sec:guard(第3.6.2節和第3.6.3節)中找到我用於此的步驟。