![Markus Schirp](/assets/img/avatar_default.png)
* Expand foo? to foo_predicate_spec.rb * Expand foo! to foo_bang_spec.rb * Execute all public method specs on mutation of private method * Warn on stderr when no spec file was found (better than nothing to be iproved later)
59 lines
1.2 KiB
Ruby
59 lines
1.2 KiB
Ruby
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
|
|
#
|
|
# @return [String]
|
|
#
|
|
# @api private
|
|
#
|
|
def self.spec_files(mutation)
|
|
ExampleLookup.run(mutation)
|
|
end
|
|
end
|
|
|
|
# Run all unit specs per mutation
|
|
class Unit < self
|
|
|
|
# Return file name pattern for mutation
|
|
#
|
|
# @return [Mutation]
|
|
#
|
|
# @api private
|
|
#
|
|
def self.spec_files(mutation)
|
|
Dir['spec/unit/**/*_spec.rb']
|
|
end
|
|
end
|
|
|
|
# Run all integration specs per mutation
|
|
class Unit < self
|
|
|
|
# Return file name pattern for mutation
|
|
#
|
|
# @return [Mutation]
|
|
#
|
|
# @api private
|
|
#
|
|
def self.spec_files(mutation)
|
|
Dir['spec/integration/**/*_spec.rb']
|
|
end
|
|
end
|
|
|
|
# Run all specs per mutation
|
|
class Full < self
|
|
def self.spec_files(mutation)
|
|
Dir['spec/**/*_spec.rb']
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|