This project is archived and is in readonly mode.
Hide test_unit generators when other frameworks are assigned as test_framework
Reported by David Chelimsky | July 14th, 2010 @ 01:25 PM
Given this in a Railtie:
When I run
Then I get the following output
... Please choose a generator below. Rails: ... Rspec: rspec:install TestUnit: test_unit:controller test_unit:helper test_unit:integration test_unit:mailer test_unit:model test_unit:observer test_unit:performance test_unit:plugin test_unit:scaffold
It would be nice if the test_unit:xxx generators were not visible here.
Need to make sure test_unit:integration DOES show up, however, if there is no integration_tool specified in a Railtie.
Comments and changes to this ticket
- Importance changed from to Low
I added following line to application.rb . However I am not seeing respec:install as one of the options. Did something change between this ticket and rails edge.
module Demo class Application < Rails::Application config.generators.test_framework = :rspec end end $ rails g Usage: rails generate GENERATOR [args] [options] General options: -h, [--help] # Print generator's options and usage -p, [--pretend] # Run but do not make any changes -f, [--force] # Overwrite files that already exist -s, [--skip] # Skip files that already exist -q, [--quiet] # Suppress status output Please choose a generator below. Rails: controller generator helper integration_test mailer migration model observer performance_test plugin resource scaffold scaffold_controller session_migration stylesheets TestUnit: test_unit:controller test_unit:helper test_unit:integration test_unit:mailer test_unit:model test_unit:observer test_unit:performance test_unit:plugin test_unit:scaffold $ gem list rspec *** LOCAL GEMS *** rspec (1.3.0) rspec-rails (1.3.2)
Sarah got the issue. The problem is that the test unit compatibility is not a gem (and I don't think it will be). The only way to effectively remove test_unit is by replacing rails/all by specific requires, as in:
This is what the --skip-activerecord option in app generator does and maybe --skip-testunit could do the same. Anyone willing to provide a patch?
This is a minor annoyance but not lets get crazy over here and say Rails 3 is neither modular nor agnostic because of this, shall we?