2012-12-07 16:55:53 +01:00
|
|
|
module Mutant
|
|
|
|
class Strategy
|
|
|
|
|
|
|
|
# Rspec strategy base class
|
|
|
|
class Rspec < self
|
|
|
|
|
|
|
|
KILLER = Killer::Forking.new(Killer::Rspec)
|
|
|
|
|
|
|
|
# DM2-style strategy
|
|
|
|
class DM2 < self
|
|
|
|
|
|
|
|
# Return filename pattern
|
|
|
|
#
|
2012-12-07 23:27:21 +01:00
|
|
|
# @return [Enumerable<String>]
|
2012-12-07 16:55:53 +01:00
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-12-11 00:17:19 +01:00
|
|
|
def spec_files(mutation)
|
2012-12-07 16:55:53 +01:00
|
|
|
ExampleLookup.run(mutation)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run all unit specs per mutation
|
|
|
|
class Unit < self
|
|
|
|
|
|
|
|
# Return file name pattern for mutation
|
|
|
|
#
|
2012-12-07 23:27:21 +01:00
|
|
|
# @return [Enumerable<String>]
|
2012-12-07 16:55:53 +01:00
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-12-11 00:17:19 +01:00
|
|
|
def spec_files(mutation)
|
2012-12-07 23:27:21 +01:00
|
|
|
['spec/unit']
|
2012-12-07 16:55:53 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run all integration specs per mutation
|
2012-12-07 23:27:21 +01:00
|
|
|
class Integration < self
|
2012-12-07 16:55:53 +01:00
|
|
|
|
|
|
|
# Return file name pattern for mutation
|
|
|
|
#
|
|
|
|
# @return [Mutation]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-12-11 00:17:19 +01:00
|
|
|
def spec_files(mutation)
|
2012-12-07 16:55:53 +01:00
|
|
|
Dir['spec/integration/**/*_spec.rb']
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run all specs per mutation
|
|
|
|
class Full < self
|
2012-12-12 22:31:14 +01:00
|
|
|
|
|
|
|
# Return spec files
|
|
|
|
#
|
|
|
|
# @return [Enumerable<String>]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-12-11 00:17:19 +01:00
|
|
|
def spec_files(mutation)
|
2012-12-07 16:55:53 +01:00
|
|
|
Dir['spec/**/*_spec.rb']
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|