free_mutant/lib/mutant/subject/method/singleton.rb
2018-09-12 13:15:43 +00:00

23 lines
460 B
Ruby

# frozen_string_literal: true
module Mutant
class Subject
class Method
# Singleton method subjects
class Singleton < self
NAME_INDEX = 1
SYMBOL = '.'.freeze
# Prepare subject for mutation insertion
#
# @return [self]
def prepare
scope.singleton_class.__send__(:undef_method, name)
self
end
end # Singleton
end # Method
end # Subject
end # Mutant