Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 4 remove test generators (especially test_unit)

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

create app with -T option.

My rails g output:

[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
like image 825
freemanoid Avatar asked Mar 08 '13 15:03

freemanoid


1 Answers

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
like image 199
Evgeny Avatar answered Oct 16 '22 16:10

Evgeny