diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2018-02-12 07:49:37 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-12 07:49:37 +0900 |
commit | 360d9bdbf387f03c0b1ca1911fe1b80781f8cce2 (patch) | |
tree | 652d5c9dca6265710ce4f141ff41652a8eca3ff9 /railties | |
parent | a2a752d1026346e3a348682551dfc952f7cf3a58 (diff) | |
parent | 24284fd3d4c4f857e54181c58feea81f819d6c0c (diff) | |
download | rails-360d9bdbf387f03c0b1ca1911fe1b80781f8cce2.tar.gz rails-360d9bdbf387f03c0b1ca1911fe1b80781f8cce2.tar.bz2 rails-360d9bdbf387f03c0b1ca1911fe1b80781f8cce2.zip |
Merge pull request #31957 from claudiob/force-master-key
Respect --force option for config/master.key
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index fd9da7803f..3eb7f6b845 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -167,7 +167,7 @@ module Rails return if options[:pretend] || options[:dummy_app] require "rails/generators/rails/master_key/master_key_generator" - master_key_generator = Rails::Generators::MasterKeyGenerator.new([], quiet: options[:quiet]) + master_key_generator = Rails::Generators::MasterKeyGenerator.new([], quiet: options[:quiet], force: options[:force]) master_key_generator.add_master_key_file_silently master_key_generator.ignore_master_key_file_silently end diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 60b9ff1317..14246edf38 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -638,6 +638,12 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_empty output end + def test_force_option + run_generator [File.join(destination_root, "myapp")] + output = run_generator [File.join(destination_root, "myapp"), "--force"] + assert_match(/force/, output) + end + def test_application_name_with_spaces path = File.join(destination_root, "foo bar") |