2014-06-02 12:57:14 +00:00
|
|
|
module Mutant
|
|
|
|
# Namespace for mutant metadata
|
|
|
|
module Meta
|
|
|
|
require 'mutant/meta/example'
|
|
|
|
require 'mutant/meta/example/dsl'
|
2016-02-29 19:03:08 +00:00
|
|
|
require 'mutant/meta/example/verification'
|
2014-06-02 12:57:14 +00:00
|
|
|
|
|
|
|
# Mutation example
|
|
|
|
class Example
|
|
|
|
|
2016-03-05 03:37:19 +00:00
|
|
|
# rubocop:disable MutableConstant
|
2014-06-02 12:57:14 +00:00
|
|
|
ALL = []
|
|
|
|
|
|
|
|
# Add example
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
def self.add(&block)
|
2014-08-16 21:13:41 +00:00
|
|
|
file = caller.first.split(':in', 2).first
|
2016-02-29 19:03:08 +00:00
|
|
|
ALL << DSL.call(file, block)
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
|
2016-02-29 19:03:08 +00:00
|
|
|
Pathname.glob(Pathname.new(__dir__).parent.parent.join('meta', '*.rb'))
|
2014-06-02 12:57:14 +00:00
|
|
|
.sort
|
|
|
|
.each(&method(:require))
|
2016-02-29 19:03:08 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
ALL.freeze
|
|
|
|
|
2016-02-29 19:03:08 +00:00
|
|
|
# Remove mutation method only present for DSL executions from meta/**/*.rb
|
|
|
|
class << self
|
|
|
|
undef_method :add
|
|
|
|
end
|
2014-06-02 12:57:14 +00:00
|
|
|
|
2016-02-29 19:03:08 +00:00
|
|
|
end # Example
|
2014-06-02 12:57:14 +00:00
|
|
|
end # Meta
|
|
|
|
end # Mutant
|