Sha256: b26ee1bee3be2e88f196e18894d86fc7d939c69c08f47f8522d84323c2e39706

Contents?: true

Size: 1008 Bytes

Versions: 11

Compression:

Stored size: 1008 Bytes

Contents

# frozen_string_literal: true

module Mutant
  module Meta
    class Example
      include Adamantium
      include Anima.new(
        :expected,
        :file,
        :lvars,
        :node,
        :original_source,
        :types
      )

      class Expected
        include Anima.new(:original_source, :node)
      end

      # Verification instance for example
      #
      # @return [Verification]
      def verification
        Verification.new(self, generated)
      end
      memoize :verification

      # Original source as generated by unparser
      #
      # @return [String]
      def original_source_generated
        Unparser.unparse(node)
      end
      memoize :original_source_generated

      # Generated mutations on example source
      #
      # @return [Enumerable<Mutant::Mutation>]
      def generated
        Mutator.mutate(node).map do |node|
          Mutation::Evil.new(self, node)
        end
      end
      memoize :generated

    end # Example
  end # Meta
end # Mutant

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mutant-0.10.11 lib/mutant/meta/example.rb
mutant-0.10.10 lib/mutant/meta/example.rb
mutant-0.10.9 lib/mutant/meta/example.rb
mutant-0.10.8 lib/mutant/meta/example.rb
mutant-0.10.7 lib/mutant/meta/example.rb
mutant-0.10.6 lib/mutant/meta/example.rb
mutant-0.10.5 lib/mutant/meta/example.rb
mutant-0.10.4 lib/mutant/meta/example.rb
mutant-0.10.1 lib/mutant/meta/example.rb
mutant-0.10.0 lib/mutant/meta/example.rb
mutant-0.9.14 lib/mutant/meta/example.rb