diff --git a/rubocop-airbnb/lib/rubocop/cop/airbnb/spec_constant_assignment.rb b/rubocop-airbnb/lib/rubocop/cop/airbnb/spec_constant_assignment.rb index 7e94de6..92ff742 100644 --- a/rubocop-airbnb/lib/rubocop/cop/airbnb/spec_constant_assignment.rb +++ b/rubocop-airbnb/lib/rubocop/cop/airbnb/spec_constant_assignment.rb @@ -33,7 +33,7 @@ class SpecConstantAssignment < Base def on_casgn(node) return unless in_spec_file?(node) parent_module_name = node.parent_module_name - if node.parent_module_name && parent_module_name != "Object" + if parent_module_name && parent_module_name != "Object" return end add_offense(node, message: MESSAGE)