free_mutant/lib/mutant/subject/method/singleton.rb

24 lines
460 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-09-12 13:15:43 +00:00
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