mutant icon indicating copy to clipboard operation
mutant copied to clipboard

Add a mutation to change constant visibility to private

Open mbj opened this issue 11 years ago • 0 comments

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.

mbj avatar Feb 20 '15 16:02 mbj