2018-09-12 14:21:24 +00:00
|
|
|
# frozen_string_literal: true
|
2018-09-12 13:15:43 +00:00
|
|
|
|
2013-07-05 00:54:50 +02:00
|
|
|
module Mutant
|
|
|
|
class Subject
|
|
|
|
class Method
|
|
|
|
# Singleton method subjects
|
|
|
|
class Singleton < self
|
|
|
|
|
|
|
|
NAME_INDEX = 1
|
2015-06-21 14:44:33 +00:00
|
|
|
SYMBOL = '.'.freeze
|
2013-07-05 00:54:50 +02:00
|
|
|
|
2014-03-15 17:00:18 +00:00
|
|
|
# Prepare subject for mutation insertion
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
def prepare
|
2014-12-07 21:14:54 +00:00
|
|
|
scope.singleton_class.__send__(:undef_method, name)
|
2014-03-15 17:00:18 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2013-07-05 00:54:50 +02:00
|
|
|
end # Singleton
|
|
|
|
end # Method
|
|
|
|
end # Subject
|
|
|
|
end # Mutant
|