我的 Rails 应用程序已经安装了guard-zeus
和rspec-rails
gems。
我Guardfile
的默认手表代码由guard init zeus
我跑guard
。当我保存文件时,该文件中的规范运行正确。
但是,当我在控制台中按回车键时guard
,我希望它能够运行整个测试套件。它试图这样做,但抛出Couldn't find test file 'rspec'
如果我zeus
自己开始(没有警卫),我可以zeus start
然后zeus rake
成功。
我无法弄清楚“rspec”文件guard
在寻找什么。这是我的 Guardfile:
guard 'zeus' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{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/requests/#{m[1]}_spec.rb"] }
end
我试过cmd: bundle exec rake
在保护块中指定 。
附加信息:
custom_plan.rb
看起来像这样:
require 'zeus/rails'
class CustomPlan < Zeus::Rails
# def my_custom_command
# # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
# end
end
Zeus.plan = CustomPlan.new
zeus.json
看起来像这样:
{
"command": "ruby -rubygems -r./custom_plan -eZeus.go",
"plan": {
"boot": {
"default_bundle": {
"development_environment": {
"prerake": {"rake": []},
"console": ["c"],
"server": ["s"],
"generate": ["g"],
"destroy": ["d"],
"dbconsole": []
},
"test_environment": {
"test_helper": {"test": ["rspec"]}
}
}
}
}
}