Sha256: df6125bbc394017493aec4fde85f6b727c6258f83d8a50bf81b978e34079ba38

Contents?: true

Size: 893 Bytes

Versions: 9

Compression:

Stored size: 893 Bytes

Contents

# frozen_string_literal: true

module Mutant
  # Namespace for mutant metadata
  module Meta
    require 'mutant/meta/example'
    require 'mutant/meta/example/dsl'
    require 'mutant/meta/example/verification'

    # Mutation example
    class Example

      # rubocop:disable MutableConstant
      ALL = []

      # Add example
      #
      # @return [undefined]
      #
      # rubocop:disable Performance/Caller
      def self.add(*types, &block)
        file = caller.first.split(':in', 2).first
        ALL << DSL.call(file, Set.new(types), block)
      end

      Pathname.glob(Pathname.new(__dir__).parent.parent.join('meta', '*.rb'))
        .sort
        .each(&method(:require))

      ALL.freeze

      # Remove mutation method only present for DSL executions from meta/**/*.rb
      class << self
        undef_method :add
      end

    end # Example
  end # Meta
end # Mutant

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mutant-0.9.4 lib/mutant/meta.rb
mutant-0.9.3 lib/mutant/meta.rb
mutant-0.9.2 lib/mutant/meta.rb
mutant-0.9.1 lib/mutant/meta.rb
mutant-0.9.0 lib/mutant/meta.rb
mutant-0.8.24 lib/mutant/meta.rb
mutant-0.8.23 lib/mutant/meta.rb
mutant-0.8.22 lib/mutant/meta.rb
mutant-0.8.21 lib/mutant/meta.rb