mutant
mutant copied to clipboard
Add a mutation to change constant visibility to private
Constants are part of a namespaces public interface. The public interface should be reduced by all means, to force exposure of the minimal public interface (and a specification of the public interface when the constant is actually part of it) the mutation would look like the following:
original:
class Foo
CONST = 1
end # Foo
mutation:
class Foo
CONST = 1
private_constant :CONST
end # Foo
This would be a ruby >= 2.1 specific mutation.