Permalink
Browse files

Skip `bootsnap` contents in `app:update` task if `bootsnap` is not used

  • Loading branch information...
y-yagi committed May 6, 2018
1 parent 1c70756 commit 9a1b99eb01eab3de4ab5c357058da0ecc38e434b
Showing with 14 additions and 0 deletions.
  1. +1 −0 railties/lib/rails/app_updater.rb
  2. +13 −0 railties/test/generators/app_generator_test.rb
@@ -27,6 +27,7 @@ def generator_options
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
@@ -323,6 +323,19 @@ def test_app_update_does_not_generate_action_cable_contents_when_skip_action_cab
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'/

0 comments on commit 9a1b99e

Please sign in to comment.