diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/app_updater.rb | 1 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/railties/lib/rails/app_updater.rb b/railties/lib/rails/app_updater.rb index a076d082d5..5e2ea93c5e 100644 --- a/railties/lib/rails/app_updater.rb +++ b/railties/lib/rails/app_updater.rb @@ -27,6 +27,7 @@ module Rails options[:skip_action_cable] = !defined?(ActionCable::Engine) options[:skip_sprockets] = !defined?(Sprockets::Railtie) options[:skip_puma] = !defined?(Puma) + options[:skip_bootsnap] = !defined?(Bootsnap) options end end diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 938d545219..bcfbcdfd80 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -323,6 +323,19 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + def test_app_update_does_not_generate_bootsnap_contents_when_skip_bootsnap_is_given + app_root = File.join(destination_root, "myapp") + run_generator [app_root, "--skip-bootsnap"] + + FileUtils.cd(app_root) do + quietly { system("bin/rails app:update") } + end + + assert_file "#{app_root}/config/boot.rb" do |content| + assert_no_match(/require 'bootsnap\/setup'/, content) + end + end + def test_gem_for_active_storage run_generator assert_file "Gemfile", /^# gem 'image_processing'/ |