lib/rubocop/cop/rspec/file_path.rb in rubocop-rspec-1.38.1 vs lib/rubocop/cop/rspec/file_path.rb in rubocop-rspec-1.39.0
- old
+ new
@@ -101,10 +101,12 @@
def ignore_methods?
cop_config['IgnoreMethods']
end
def filename_ends_with?(glob)
- File.fnmatch?("*#{glob}", processed_source.buffer.name)
+ filename =
+ RuboCop::PathUtil.relative_path(processed_source.buffer.name)
+ File.fnmatch?("*#{glob}", filename)
end
def relevant_rubocop_rspec_file?(_file)
true
end