lib/rubocop/cop/rspec/file_path.rb in rubocop-rspec-1.2.2 vs lib/rubocop/cop/rspec/file_path.rb in rubocop-rspec-1.3.0
- old
+ new
@@ -33,10 +33,12 @@
private
def matcher(object, method)
path = File.join(parts(object))
- path += '*' + method.children.first.gsub(/\W+/, '') if method
+ if method && method.type == :str
+ path += '*' + method.children.first.gsub(/\W+/, '')
+ end
"#{path}*_spec.rb"
end
def parts(object)