rubocops/components_order: skip fails_with inside on_system

This commit is contained in:
Michael Cho 2025-09-14 20:38:30 -04:00
parent 6c44d1a8f1
commit 0cb2ecdbd2
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85

View File

@ -125,7 +125,8 @@ module RuboCop
end end
def check_on_system_block_content(component_precedence_list, on_system_block) def check_on_system_block_content(component_precedence_list, on_system_block)
if on_system_block.body.block_type? && !on_system_methods.include?(on_system_block.body.method_name) if on_system_block.body.block_type? && !on_system_methods.include?(on_system_block.body.method_name) &&
on_system_block.body.method_name != :fails_with
offending_node(on_system_block) offending_node(on_system_block)
problem "Nest `#{on_system_block.method_name}` blocks inside `#{on_system_block.body.method_name}` " \ problem "Nest `#{on_system_block.method_name}` blocks inside `#{on_system_block.body.method_name}` " \
"blocks when there is only one inner block." do |corrector| "blocks when there is only one inner block." do |corrector|