Sha256: 29b63bbe54fe757777afe26b2e188ae8958321de5e16acb563e92fc4832c9e90

Contents?: true

Size: 1.18 KB

Versions: 7

Compression:

Stored size: 1.18 KB

Contents

module Mutant
  class Subject
    # Abstract base class for method subjects
    class Method < self

      # Test if method is public
      #
      # @return [true]
      #   if method is public
      #
      # @return [false]
      #   otherwise
      #
      # @api private
      #
      abstract_method :public?

      # Return method name
      #
      # @return [Symbol]
      #
      # @api private
      #
      def name
        node.children[self.class::NAME_INDEX]
      end

    private

      # Return mutations
      #
      # @param [#<<] emitter
      #
      # @return [undefined]
      #
      # @api private
      #
      def generate_mutations(emitter)
        emitter << noop_mutation
        Mutator.each(node) do |mutant|
          emitter << Mutation::Evil.new(self, mutant)
        end
      end

      # Return scope
      #
      # @return [Class, Module]
      #
      # @api private
      #
      def scope
        context.scope
      end

      # Return subtype identifier
      #
      # @return [String]
      #
      # @api private
      #
      def subtype
        "#{context.identification}#{self.class::SYMBOL}#{name}"
      end

    end # Method
  end # Subject
end # Mutant

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 lib/mutant/subject/method.rb
mutant-0.3.0.beta20 lib/mutant/subject/method.rb
mutant-0.3.0.beta19 lib/mutant/subject/method.rb
mutant-0.3.0.beta18 lib/mutant/subject/method.rb
mutant-0.3.0.beta17 lib/mutant/subject/method.rb
mutant-0.3.0.beta16 lib/mutant/subject/method.rb
mutant-0.3.0.beta15 lib/mutant/subject/method.rb