diff --git a/lib/rubocop/cop/rspec/file_path.rb b/lib/rubocop/cop/rspec/file_path.rb index ed4fbf444..aa1c19bb6 100644 --- a/lib/rubocop/cop/rspec/file_path.rb +++ b/lib/rubocop/cop/rspec/file_path.rb @@ -165,7 +165,7 @@ def routing_spec_path? end def expanded_file_path - File.expand_path(processed_source.buffer.name) + File.expand_path(processed_source.file_path) end end end