free_mutant/spec/integration/mutant/rspec_spec.rb
Markus Schirp e9931f6abe Slightly refactor CLI
* Backlists should "work" now.
* CLI (match expression) classifiers are not used as matchers anymore
2013-09-13 22:34:19 +02:00

31 lines
962 B
Ruby

# encoding: utf-8
require 'spec_helper'
describe Mutant, 'rspec integration' do
around do |example|
Dir.chdir(TestApp.root) do
example.run
end
end
specify 'it allows to kill mutations' do
Kernel.system('bundle exec mutant -I lib --require test_app --rspec ::TestApp::Literal#string').should be(true)
end
specify 'it allows to exclude mutations' do
Kernel.system('bundle exec mutant -I lib --require test_app --rspec ::TestApp::Literal#string --ignore-subject ::TestApp::Literal#uncovered_string').should be(true)
end
specify 'fails to kill mutations when they are not covered' do
cli = 'bundle exec mutant -I lib --require test_app --rspec ::TestApp::Literal#uncovered_string'
Kernel.system(cli).should be(false)
end
specify 'fails when some mutations are not covered' do
cli = 'bundle exec mutant -I lib --require test_app --rspec ::TestApp::Literal'
Kernel.system(cli).should be(false)
end
end