aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-01-31 08:42:39 -0800
committerJosé Valim <jose.valim@plataformatec.com.br>2012-01-31 08:42:39 -0800
commitcf63e3053dfa9ad6d703fd14c3ac19816d013f2f (patch)
tree4444fa48c3bd08ee3d722b45afa5273f536987f2
parent10c50c6b55ef75a9682201eadd8955abbbcb27d9 (diff)
parent0c0e58c913c041c3031342e78cbf7117eb1b971c (diff)
downloadrails-cf63e3053dfa9ad6d703fd14c3ac19816d013f2f.tar.gz
rails-cf63e3053dfa9ad6d703fd14c3ac19816d013f2f.tar.bz2
rails-cf63e3053dfa9ad6d703fd14c3ac19816d013f2f.zip
Merge pull request #4797 from kennyj/fix_4774
Fix GH #4744. Don't run bundle install when executing `rails new app` with --pretend option
-rw-r--r--railties/lib/rails/generators/app_base.rb2
-rw-r--r--railties/test/generators/app_generator_test.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index d3420a6a3c..6677850a11 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -248,7 +248,7 @@ module Rails
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 = {})
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index e2c98274b1..a3c24c392b 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -355,6 +355,11 @@ class AppGeneratorTest < Rails::Generators::TestCase
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)