freemanoid
freemanoid

Reputation: 14770

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

Upvotes: 8

Views: 1874

Answers (1)

Evgeny Zislis
Evgeny Zislis

Reputation: 6957

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

Upvotes: 10

Related Questions