Browse files

Load spec_helper.rb for rspec strategies

  • Loading branch information...
1 parent 62cf07f commit 3562d4f627e51845e1689e1618d7e85570b8ff49 Markus Schirp committed Jan 18, 2013
Showing with 17 additions and 3 deletions.
  1. +11 −0 lib/mutant/strategy/rspec.rb
  2. +3 −3 spec/integration/mutant/rspec_killer_spec.rb
  3. +3 −0 test_app/spec/spec_helper.rb
View
11 lib/mutant/strategy/rspec.rb
@@ -6,6 +6,17 @@ class Rspec < self
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
View
6 spec/integration/mutant/rspec_killer_spec.rb
@@ -11,14 +11,14 @@
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
View
3 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

0 comments on commit 3562d4f

Please sign in to comment.