File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ def generator_options
69
69
skip_action_mailbox : !defined? ( ActionMailbox ::Engine ) ,
70
70
skip_action_text : !defined? ( ActionText ::Engine ) ,
71
71
skip_action_cable : !defined? ( ActionCable ::Engine ) ,
72
+ skip_brakeman : skip_gem? ( "brakeman" ) ,
73
+ skip_rubocop : skip_gem? ( "rubocop" ) ,
72
74
skip_test : !defined? ( Rails ::TestUnitRailtie ) ,
73
75
skip_system_test : Rails . application . config . generators . system_tests . nil? ,
74
76
asset_pipeline : asset_pipeline ,
@@ -87,6 +89,13 @@ def asset_pipeline
87
89
nil
88
90
end
89
91
end
92
+
93
+ def skip_gem? ( gem_name )
94
+ gem gem_name
95
+ false
96
+ rescue LoadError
97
+ true
98
+ end
90
99
end
91
100
end
92
101
end
Original file line number Diff line number Diff line change @@ -286,6 +286,26 @@ def test_app_update_preserves_skip_action_text
286
286
end
287
287
end
288
288
289
+ def test_app_update_preserves_skip_brakeman
290
+ run_generator [ destination_root , "--skip-brakeman" ]
291
+
292
+ FileUtils . cd ( destination_root ) do
293
+ assert_no_changes -> { File . exist? ( "bin/brakeman" ) } do
294
+ run_app_update
295
+ end
296
+ end
297
+ end
298
+
299
+ def test_app_update_preserves_skip_rubocop
300
+ run_generator [ destination_root , "--skip-rubocop" ]
301
+
302
+ FileUtils . cd ( destination_root ) do
303
+ assert_no_changes -> { File . exist? ( "bin/rubocop" ) } do
304
+ run_app_update
305
+ end
306
+ end
307
+ end
308
+
289
309
def test_app_update_preserves_skip_test
290
310
run_generator [ destination_root , "--skip-test" ]
291
311
You can’t perform that action at this time.
0 commit comments