Rails 4删除测试生成器(尤其是test_unit) [英] Rails 4 remove test generators (especially test_unit)
本文介绍了Rails 4删除测试生成器(尤其是test_unit)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何删除test_unit生成器以使其从rails generate
列表中消失?
How I can remove test_unit generators to make them disappear from the rails generate
list?
我已经尝试了一些对我不起作用的方法:
I have already tried some ways that did not work for me:
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
中,您可以隐藏一些您不想看到的生成器.例如:
In your config/application.rb
where you have the generations settings, you can hide some of the generators you don't want to see. For example:
config.generators do |g|
g.hidden_namespaces << :test_unit << :erb
g.test_framework :mini_test
g.template_engine :slim
# ...
end
这篇关于Rails 4删除测试生成器(尤其是test_unit)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文