From 0c0e58c913c041c3031342e78cbf7117eb1b971c Mon Sep 17 00:00:00 2001 From: kennyj Date: Tue, 31 Jan 2012 20:10:22 +0900 Subject: Don't run bundle install when passed with --pretend option --- railties/lib/rails/generators/app_base.rb | 2 +- railties/test/generators/app_generator_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3