我不知道为什么libnotify停止显示有关已完成测试的信息。它显示了Spork消息:"Rspec成功启动“。但在此之后不会显示任何内容。我用的是Ubuntu。
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" }
endRunning 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
发布于 2012-04-23 01:08:14
我也遇到了这个问题,并安装了guard-spork (https://github.com/guard/guard-spork) gem (将其添加到我的rails Gemfile和已安装的包中)。然后,根据该页面上的说明,我运行了'guard init spork‘,它会在您的Guardfile中添加一个'spork’部分,以获取您可以查看的文件。
当我运行bundle exec guard时,它实际上确保了spork也是启动的!我的测试文件更改正在运行,并将结果发布到通知程序。需要说明的是,我使用的是带有ruby rvm的Ubuntu 11.10 64位。我的Gemfile中相关的gem是gem 'guard-rspec',gem 'guard-spork',gem 'rspec-rails',gem 'watchr',gem 'spork',gem 'libnotify‘。不确定是否所有都是相关的。
你可以在Hartl令人敬畏的Rails教程http://ruby.railstutorial.org/chapters/static-pages#sec:guard ( 3.6.2和3.6.3节)中找到我在这方面使用的分步指南。
https://stackoverflow.com/questions/8805278
复制相似问题