2012-08-14 22:45:34 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Mutant, 'runner' do
|
2012-10-26 11:24:29 +02:00
|
|
|
before do
|
|
|
|
pending
|
|
|
|
end
|
|
|
|
|
2012-08-14 22:45:34 +02:00
|
|
|
around do |example|
|
|
|
|
Dir.chdir(TestApp.root) do
|
|
|
|
example.run
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'allows to run mutant over a project' do
|
2012-08-16 19:10:24 +02:00
|
|
|
output = StringIO.new
|
2012-08-16 04:10:54 +02:00
|
|
|
runner = Mutant::Runner.run(
|
|
|
|
:killer => Mutant::Killer::Rspec,
|
2012-09-16 00:51:47 +02:00
|
|
|
:matcher => Mutant::Matcher::ObjectSpace.new(/\ATestApp::/),
|
2012-08-16 19:10:24 +02:00
|
|
|
:reporter => Mutant::Reporter::CLI.new(output)
|
2012-08-16 04:10:54 +02:00
|
|
|
)
|
|
|
|
runner.fail?.should be(true)
|
2012-08-16 19:10:24 +02:00
|
|
|
runner.errors.size.should be(22)
|
|
|
|
output.rewind
|
2012-09-16 00:51:47 +02:00
|
|
|
output.lines.grep(/Mutant alive:/).size.should be(22)
|
2012-08-14 22:45:34 +02:00
|
|
|
end
|
|
|
|
end
|