如何删除 test_unit 生成器以使它们从 railsgenerate
列表中消失?
我已经尝试过一些对我不起作用的方法:
config.generators do |g|
g.test_framework nil
end
使用-T
选项创建应用程序。
我的rails g
输出:
[a lot of other generators skipped]
TestUnit:
test_unit:controller
test_unit:helper
test_unit:integration
test_unit:mailer
test_unit:model
test_unit:plugin
test_unit:scaffold
最佳答案
在您的 config/application.rb
中进行生成设置,您可以隐藏一些您不想看到的生成器。例如:
config.generators do |g|
g.hidden_namespaces << :test_unit << :erb
g.test_framework :mini_test
g.template_engine :slim
# ...
end
关于ruby-on-rails - Rails 4 删除了测试生成器(尤其是 test_unit),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15297981/