Skip to content

Commit

Permalink
Don't run bundle install when passed with --pretend option
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyj committed Jan 31, 2012
1 parent 40b2189 commit 0c0e58c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/generators/app_base.rb
Expand Up @@ -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 = {})
Expand Down
5 changes: 5 additions & 0 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 0c0e58c

Please sign in to comment.