lib/rubocop/cop/rspec/describe_method.rb in rubocop-rspec-1.29.1 vs lib/rubocop/cop/rspec/describe_method.rb in rubocop-rspec-1.30.0
- old
+ new
@@ -21,14 +21,12 @@
include RuboCop::RSpec::Util
MSG = 'The second argument to describe should be the method '\
"being tested. '#instance' or '.class'.".freeze
- METHOD_STRING_MATCHER = /\A[\#\.].+/
-
def on_top_level_describe(_node, (_, second_arg))
return unless second_arg && second_arg.str_type?
- return if METHOD_STRING_MATCHER =~ second_arg.str_content
+ return if second_arg.str_content.start_with?('#', '.')
add_offense(second_arg, location: :expression)
end
end
end