ruby/did_you_mean

Incorret correction when raed is called on File

yuki24 opened this issue · 0 comments

Actual (suggesting rand):

File.raed
# => NoMethodError: undefined method `raed' for File:Class
# Did you mean?  rand

Expected (suggesting read):

File.raed
# => NoMethodError: undefined method `raed' for File:Class
# Did you mean?  read

This is because the MethodNameChecker always refers to a set of private method names and it ends up displaying rand whose Levenshtein distance between raed is 1.