2012-08-14 06:27:56 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Mutant,'rspec integration' do
|
2012-10-26 05:24:29 -04:00
|
|
|
before do
|
|
|
|
pending
|
|
|
|
end
|
|
|
|
|
2012-08-14 06:27:56 -04:00
|
|
|
around do |example|
|
|
|
|
Dir.chdir(TestApp.root) do
|
|
|
|
example.run
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
specify 'allows to run rspec with mutations' do
|
|
|
|
|
|
|
|
Mutant::Matcher::Method.parse('TestApp::Literal#string').each do |subject|
|
|
|
|
subject.each do |mutation|
|
2012-08-15 22:10:54 -04:00
|
|
|
runner = Mutant::Killer::Rspec.run(mutation)
|
|
|
|
runner.fail?.should be(false)
|
2012-08-14 06:27:56 -04:00
|
|
|
end
|
2012-08-15 22:10:54 -04:00
|
|
|
subject.reset
|
2012-08-14 06:27:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Matcher::Method.parse('TestApp::Literal#uncovered_string').each do |subject|
|
|
|
|
subject.each do |mutation|
|
2012-08-15 22:10:54 -04:00
|
|
|
runner = Mutant::Killer::Rspec.run(mutation)
|
|
|
|
runner.fail?.should be(true)
|
2012-08-14 06:27:56 -04:00
|
|
|
end
|
2012-08-15 22:10:54 -04:00
|
|
|
subject.reset
|
2012-08-14 06:27:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|