free_mutant/lib/mutant/strategy/rspec.rb
2013-01-18 21:38:46 +01:00

63 lines
1.2 KiB
Ruby

module Mutant
class Strategy
# Rspec strategy base class
class Rspec < self
KILLER = Killer::Forking.new(Killer::Rspec)
# Setup rspec strategy
#
# @return [self]
#
# @api private
#
def setup
require('./spec/spec_helper.rb')
self
end
# Run all unit specs per mutation
class Unit < self
# Return file name pattern for mutation
#
# @return [Enumerable<String>]
#
# @api private
#
def spec_files(mutation)
Dir['spec/unit/**/*_spec.rb']
end
end
# Run all integration specs per mutation
class Integration < self
# Return file name pattern for mutation
#
# @return [Mutation]
#
# @api private
#
def spec_files(mutation)
Dir['spec/integration/**/*_spec.rb']
end
end
# Run all specs per mutation
class Full < self
# Return spec files
#
# @return [Enumerable<String>]
#
# @api private
#
def spec_files(mutation)
Dir['spec/**/*_spec.rb']
end
end
end
end
end