Permalink
Browse files

Merge pull request #4797 from kennyj/fix_4774

Fix GH #4744. Don't run bundle install when executing `rails new app` with --pretend option
  • Loading branch information...
2 parents 10c50c6 + 0c0e58c commit cf63e3053dfa9ad6d703fd14c3ac19816d013f2f @josevalim josevalim committed Jan 31, 2012
Showing with 6 additions and 1 deletion.
  1. +1 −1 railties/lib/rails/generators/app_base.rb
  2. +5 −0 railties/test/generators/app_generator_test.rb
View
2 railties/lib/rails/generators/app_base.rb
@@ -248,7 +248,7 @@ def bundle_command(command)
end
def run_bundle
- bundle_command('install') unless options[:skip_gemfile] || options[:skip_bundle]
+ bundle_command('install') unless options[:skip_gemfile] || options[:skip_bundle] || options[:pretend]
end
def empty_directory_with_gitkeep(destination, config = {})
View
5 railties/test/generators/app_generator_test.rb
@@ -355,6 +355,11 @@ def test_active_record_dependent_restrict_raises_is_present_application_config
assert_file "config/application.rb", /config\.active_record\.dependent_restrict_raises = false/
end
+ def test_pretend_option
+ output = run_generator [File.join(destination_root, "myapp"), "--pretend"]
+ assert_no_match(/run bundle install/, output)
+ end
+
protected
def action(*args, &block)

0 comments on commit cf63e30

Please sign in to comment.