free_mutant/lib/mutant/killer/rspec.rb
Markus Schirp 5b3d506523 Reconnect API changes for successful spec run
Sorry this looks like spiking around and yeah it was some kind of.
2013-01-22 00:00:30 +01:00

39 lines
767 B
Ruby

module Mutant
class Killer
# Runner for rspec tests
class Rspec < self
TYPE = 'rspec'.freeze
private
# Run rspec test
#
# @return [true]
# when test is NOT successful and the mutant was killed
#
# @return [false]
# otherwise
#
# @api private
#
def run
mutation.insert
!!::RSpec::Core::Runner.run(command_line_arguments, strategy.error_stream, strategy.output_stream).nonzero?
end
memoize :run
# Return command line arguments
#
# @return [Array]
#
# @api private
#
def command_line_arguments
%W(
--fail-fast
) + strategy.spec_files(mutation.subject)
end
end
end
end