diff --git a/lib/mutant/strategy/rspec.rb b/lib/mutant/strategy/rspec.rb index 491155b9..eb53b553 100644 --- a/lib/mutant/strategy/rspec.rb +++ b/lib/mutant/strategy/rspec.rb @@ -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 diff --git a/spec/integration/mutant/rspec_killer_spec.rb b/spec/integration/mutant/rspec_killer_spec.rb index 8dbcf568..182930a3 100644 --- a/spec/integration/mutant/rspec_killer_spec.rb +++ b/spec/integration/mutant/rspec_killer_spec.rb @@ -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 diff --git a/test_app/spec/spec_helper.rb b/test_app/spec/spec_helper.rb index 870045ac..30af8493 100644 --- a/test_app/spec/spec_helper.rb +++ b/test_app/spec/spec_helper.rb @@ -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