Open
Description
This is for Ruby but I'm guessing it also applies to Python/Javascript. I've noticed a user overwriting comparison methods(and methods related to the return type of the method) to bypass test cases.
I tested this myself and was able to pass the few katas I tried simply by monkey patching Object or NilClass methods. For some katas it's as simple as
class Object
def ==(o)
true
end
end
or
class Object
def !=(o)
false
end
end
See cw-2.rb#L112, related kumite
Maybe core classes should be frozen like the Test class is, though that could interfere with katas that rely on the user monkey patching. A better solution might be to use untouched/unmodified comparison methods.