From c050cad44d973d9ebc63eafb681f946db0f96c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Barri=C3=A9?= Date: Fri, 8 Nov 2024 11:00:55 +0100 Subject: [PATCH] Don't add bin/thrust if thruster is not in Gemfile --- railties/lib/rails/commands/app/update_command.rb | 1 + railties/test/generators/app_generator_test.rb | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/railties/lib/rails/commands/app/update_command.rb b/railties/lib/rails/commands/app/update_command.rb index b4fef5e7f48b..7301c2d4a1d0 100644 --- a/railties/lib/rails/commands/app/update_command.rb +++ b/railties/lib/rails/commands/app/update_command.rb @@ -71,6 +71,7 @@ def generator_options skip_action_cable: !defined?(ActionCable::Engine), skip_brakeman: skip_gem?("brakeman"), skip_rubocop: skip_gem?("rubocop"), + skip_thruster: skip_gem?("thruster"), skip_test: !defined?(Rails::TestUnitRailtie), skip_system_test: Rails.application.config.generators.system_tests.nil?, skip_asset_pipeline: asset_pipeline.nil?, diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index f0cb29c966b4..929622b25cdc 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -304,6 +304,16 @@ def test_app_update_preserves_skip_rubocop end end + def test_app_update_preserves_skip_thruster + run_generator [ destination_root, "--skip-thruster" ] + + FileUtils.cd(destination_root) do + assert_no_changes -> { File.exist?("bin/thrust") } do + run_app_update + end + end + end + def test_app_update_preserves_skip_test run_generator [ destination_root, "--skip-test" ]