Test both rspec 2 and 3

This commit is contained in:
Andrey Savchenko 2014-03-03 20:00:57 +02:00
parent 9f0dbeebe2
commit 30092dd956
4 changed files with 43 additions and 23 deletions

1
.gitignore vendored
View file

@ -33,6 +33,7 @@ measurements
## BUNDLER
.bundle
Gemfile.lock
Gemfile.*.lock
## PROJECT::SPECIFIC
/vendor

View file

@ -4,13 +4,17 @@ require 'spec_helper'
describe Mutant, 'rspec integration' do
let(:base_cmd) { "bundle exec mutant -I lib --require test_app --use rspec" }
shared_examples_for 'rspec integration' do
around do |example|
Bundler.with_clean_env do
Dir.chdir(TestApp.root) do
Kernel.system("bundle install --gemfile=#{gemfile}")
example.run
end
end
let(:base_cmd) { 'bundle exec mutant -I lib --require test_app --use rspec' }
end
specify 'it allows to kill mutations' do
expect(Kernel.system("#{base_cmd} ::TestApp::Literal#string")).to be(true)
@ -35,4 +39,17 @@ describe Mutant, 'rspec integration' do
cli = "#{base_cmd} ::TestApp::Literal"
expect(Kernel.system(cli)).to be(false)
end
end
context 'RSpec 2' do
let(:gemfile) { 'Gemfile.rspec2' }
it_behaves_like 'rspec integration'
end
context 'Rspec 3' do
let(:gemfile) { 'Gemfile.rspec3' }
it_behaves_like 'rspec integration'
end
end

1
test_app/Gemfile.rspec2 Normal file
View file

@ -0,0 +1 @@
gem 'rspec', '~> 2.14.1'

1
test_app/Gemfile.rspec3 Normal file
View file

@ -0,0 +1 @@
gem 'rspec', '~> 3.0.0.beta2'