2012-08-14 06:27:56 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Mutant,'rspec integration' do
|
2012-10-26 05:24:29 -04:00
|
|
|
|
2012-08-14 06:27:56 -04:00
|
|
|
around do |example|
|
|
|
|
Dir.chdir(TestApp.root) do
|
|
|
|
example.run
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-11-24 11:36:47 -05:00
|
|
|
let(:strategy) { Mutant::Strategy::Rspec::DM2 }
|
2012-08-14 06:27:56 -04:00
|
|
|
|
2012-11-24 11:36:47 -05:00
|
|
|
specify 'allows to kill mutations' do
|
|
|
|
Kernel.system("bundle exec mutant -I lib -r test_app --rspec-dm2 ::TestApp::Literal#string").should be(true)
|
|
|
|
end
|
2012-08-14 06:27:56 -04:00
|
|
|
|
2012-11-24 11:36:47 -05:00
|
|
|
specify 'fails to kill mutations when they are not covered' do
|
|
|
|
Kernel.system("bundle exec mutant -I lib -r test_app --rspec-dm2 ::TestApp::Literal#uncovered_string").should be(false)
|
2012-08-14 06:27:56 -04:00
|
|
|
end
|
2012-11-24 11:39:27 -05:00
|
|
|
|
|
|
|
specify 'fails when some mutations when are not covered' do
|
|
|
|
Kernel.system("bundle exec mutant -I lib -r test_app --rspec-dm2 ::TestApp::Literal").should be(false)
|
|
|
|
end
|
2012-08-14 06:27:56 -04:00
|
|
|
end
|