Load spec_helper.rb for rspec strategies
This commit is contained in:
parent
62cf07f5e6
commit
3562d4f627
3 changed files with 17 additions and 3 deletions
|
@ -6,6 +6,17 @@ module Mutant
|
|||
|
||||
KILLER = Killer::Forking.new(Killer::Rspec)
|
||||
|
||||
# Setup rspec strategy
|
||||
#
|
||||
# @return [self]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def setup
|
||||
require('./spec/spec_helper.rb')
|
||||
self
|
||||
end
|
||||
|
||||
# Run all unit specs per mutation
|
||||
class Unit < self
|
||||
|
||||
|
|
|
@ -11,14 +11,14 @@ describe Mutant,'rspec integration' do
|
|||
let(:strategy) { Mutant::Strategy::Rspec::DM2 }
|
||||
|
||||
specify 'allows to kill mutations' do
|
||||
Kernel.system("bundle exec mutant -I lib -r test_app --rspec-dm2 ::TestApp::Literal#string").should be(true)
|
||||
Kernel.system('bundle exec mutant --rspec-dm2 ::TestApp::Literal#string').should be(true)
|
||||
end
|
||||
|
||||
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)
|
||||
Kernel.system('bundle exec mutant --rspec-dm2 ::TestApp::Literal#uncovered_string').should be(false)
|
||||
end
|
||||
|
||||
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)
|
||||
Kernel.system('bundle exec mutant --rspec-dm2 ::TestApp::Literal').should be(false)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'rspec'
|
||||
|
||||
$: << File.join(File.dirname(__FILE__), 'lib')
|
||||
|
||||
require 'test_app'
|
||||
|
||||
# require spec support files and shared behavior
|
||||
|
|
Loading…
Add table
Reference in a new issue