7293386c26
* rubocop still warns about this on ruby 1.9.3, so it was fixed so it produces less output on travis.
49 lines
886 B
Ruby
49 lines
886 B
Ruby
# encoding: utf-8
|
|
|
|
module Mutant
|
|
class Mutator
|
|
# Namespace for utility mutators
|
|
class Util < self
|
|
|
|
# Run ulitity mutator
|
|
#
|
|
# @param [Object] object
|
|
# @param [Object] parent
|
|
#
|
|
# @return [Enumerator<Object>]
|
|
# if no block given
|
|
#
|
|
# @return [self]
|
|
# otherwise
|
|
#
|
|
# @api private
|
|
#
|
|
def self.each(object, parent, &block)
|
|
return to_enum(__method__, object, parent) unless block_given?
|
|
|
|
new(object, parent, block)
|
|
|
|
self
|
|
end
|
|
|
|
private
|
|
|
|
# Test if mutation is new
|
|
#
|
|
# @param [Object] generated
|
|
#
|
|
# @return [true]
|
|
# if object is new
|
|
#
|
|
# @return [false]
|
|
# otherwise
|
|
#
|
|
# @api private
|
|
#
|
|
def new?(generated)
|
|
input != generated
|
|
end
|
|
|
|
end # Util
|
|
end # Mutator
|
|
end # Mutant
|