Skip to content

Include documentation on how to prevent monkey patching for a given language #57

Open
@10XL

Description

@10XL

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions