我刚刚从使用带有 Guard 的 Spork 切换到使用Zeus
我使用了这个分步指南:http ://blog.blenderbox.com/2014/04/10/testing-rails-3-with-guard-and-zeus/
事情,现在我的日常是
在终端窗口中执行 $ zeus start
在另一个终端窗口中:guard
在另一个窗口中:$rspec
我的测试运行良好,但我很惊讶 rspec 测试套件比使用 Spork 的速度慢,因为大多数人都说它极大地提高了测试速度。
还让我真正认为存在错误的是,当我键入 rspec 时,它会在运行测试之前显示一条消息,阅读以下内容:
No DRb server is running. Running in local process instead
有人知道有什么问题吗?
谢谢
保护文件
require 'active_support/core_ext'
require 'active_support/inflector'
# NEw ZEUS guard
# source - blog.blenderbox.com/2014/04/10/testing-rails-3-with-guard-and-zeus/
guard 'zeus-client', :all_on_start => false, :all_after_pass => false do
ignore %r{^\.zeus\.sock$}
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
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{^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 features specs
watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
guard 'rails-assets', :run_on => [:start, :change] do
watch(%r{^app/assets/.+$})
watch('config/application.rb')
end