[rspec-users] installing RSpec requires changing generators in config/applicaton.rb?

Daniel Kehoe groups at fortuity.com
Tue Mar 1 15:59:31 EST 2011

All the RSpec installation instructions I've seen (except the RSpec
Book) say something like:

Set up the RSpec generator by adding the following to config/
config.generators do |g|
  g.test_framework :rspec


Create a generator configuration file config/initializers/
generators.rb containing:
Rails.application.config.generators do |g|
    g.test_framework = :rspec

Are either of these necessary? It seems when I leave out this step
that running
"rails generate controller home index"
creates all the necessary files in the rspec directory.

Was there a recent improvement that eliminates the need to set up
rspec in config.generators? Or am I missing something?

I'm using Rails 3.0.5 and rspec-rails 2.5.

-- Daniel

More information about the rspec-users mailing list