Skip to content

Commit

Permalink
Hook into rails-3 generators using 3.0 and 3.1 APIs
Browse files Browse the repository at this point in the history
- Rails-3.1 will change the API for hooking into generators from
  "config.generators" to "config.app_generators".
- This commit supports either.
  • Loading branch information
dchelimsky committed Oct 2, 2010
1 parent ca16b51 commit f5ba00e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rspec-rails.rb
@@ -1,8 +1,10 @@
module RSpec
module Rails
class Railtie < ::Rails::Railtie
config.generators.integration_tool :rspec
config.generators.test_framework :rspec
# Rails-3.0.1 requires config.app_generators instead of 3.0.0's config.generators
generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators
generators.integration_tool :rspec
generators.test_framework :rspec

rake_tasks do
load "rspec/rails/tasks/rspec.rake"
Expand Down

0 comments on commit f5ba00e

Please sign in to comment.