如何修改我的 zeus.json 文件以在与我的应用程序一起开发的引擎中运行 rspec 测试?
我的 Rails 应用程序看起来像这样:
/config
/engines
/engine <-- this is the engine I'm developing inside the parent app
/spec <-- here are the rspec tests
/custom_plan.rb
/zeus.json
通常,我cd
进入引擎/引擎并运行rspec
引擎测试(它有一个运行的虚拟应用程序)。
zeus init
在顶层目录中运行会创建zeus.json和custom_plan.rb:
{
"command": "ruby -rubygems -r./custom_plan -eZeus.go",
"plan": {
"boot": {
"default_bundle": {
"development_environment": {
"prerake": {"rake": []},
"runner": ["r"],
"console": ["c"],
"server": ["s"],
"generate": ["g"],
"destroy": ["d"],
"dbconsole": []
},
"test_environment": {
"test_helper": {"test": ["rspec", "testrb"]}
}
}
}
}
}
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 start
test_helper 启动失败时
cannot load such file -- test_helper (LoadError)
我的猜测是因为我的规格当前位于引擎/引擎/规格中,并且父应用程序中没有“规格”文件夹。我希望能够更新我的 custom_plan 来运行这些测试。取而代之的是,我希望能够在引擎中创建一个单独的计划和 zeus.json,但是当我cd
进入引擎/引擎并运行 zeus init 时,它仍然会在应用程序的根目录下创建配置文件,所以我不确定如何让宙斯“进入”我的引擎。
帮助表示赞赏。