Sha256: cafff8a15e4b52033fe55f1a5397d51a15e3bc158bad947785e880b4d9705af5

Contents?: true

Size: 769 Bytes

Versions: 18

Compression:

Stored size: 769 Bytes

Contents

# frozen_string_literal: true

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

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

      # Normalized source
      #
      # @return [String]
      def source
        Unparser.unparse(node)
      end
      memoize :source

      # 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

18 entries across 18 versions & 1 rubygems

Version Path
mutant-0.9.13 lib/mutant/meta/example.rb
mutant-0.9.12 lib/mutant/meta/example.rb
mutant-0.9.11 lib/mutant/meta/example.rb
mutant-0.9.10 lib/mutant/meta/example.rb
mutant-0.9.9 lib/mutant/meta/example.rb
mutant-0.9.8 lib/mutant/meta/example.rb
mutant-0.9.7 lib/mutant/meta/example.rb
mutant-0.9.6 lib/mutant/meta/example.rb
mutant-0.9.5 lib/mutant/meta/example.rb
mutant-0.9.4 lib/mutant/meta/example.rb
mutant-0.9.3 lib/mutant/meta/example.rb
mutant-0.9.2 lib/mutant/meta/example.rb
mutant-0.9.1 lib/mutant/meta/example.rb
mutant-0.9.0 lib/mutant/meta/example.rb
mutant-0.8.24 lib/mutant/meta/example.rb
mutant-0.8.23 lib/mutant/meta/example.rb
mutant-0.8.22 lib/mutant/meta/example.rb
mutant-0.8.21 lib/mutant/meta/example.rb