Skip to content
This repository
Browse code

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...
commit cf63e3053dfa9ad6d703fd14c3ac19816d013f2f 2 parents 10c50c6 + 0c0e58c
José Valim josevalim authored
2  railties/lib/rails/generators/app_base.rb
@@ -248,7 +248,7 @@ def bundle_command(command)
248 248 end
249 249
250 250 def run_bundle
251   - bundle_command('install') unless options[:skip_gemfile] || options[:skip_bundle]
  251 + bundle_command('install') unless options[:skip_gemfile] || options[:skip_bundle] || options[:pretend]
252 252 end
253 253
254 254 def empty_directory_with_gitkeep(destination, config = {})
5 railties/test/generators/app_generator_test.rb
@@ -355,6 +355,11 @@ def test_active_record_dependent_restrict_raises_is_present_application_config
355 355 assert_file "config/application.rb", /config\.active_record\.dependent_restrict_raises = false/
356 356 end
357 357
  358 + def test_pretend_option
  359 + output = run_generator [File.join(destination_root, "myapp"), "--pretend"]
  360 + assert_no_match(/run bundle install/, output)
  361 + end
  362 +
358 363 protected
359 364
360 365 def action(*args, &block)

0 comments on commit cf63e30

Please sign in to comment.
Something went wrong with that request. Please try again.