Add rspec metadata flag to blacklist an example group from mutation testing

This commit is contained in:
Markus Schirp 2014-12-13 01:06:04 +00:00
parent 9c65e409a6
commit 84c2f75cf4
6 changed files with 8 additions and 6 deletions

View file

@ -114,7 +114,9 @@ module Mutant
# @api private
#
def all_examples
@world.example_groups.flat_map(&:descendants).flat_map(&:examples)
@world.example_groups.flat_map(&:descendants).flat_map(&:examples).select do |example|
example.metadata.fetch(:mutant, true)
end
end
# Filter examples

View file

@ -1,4 +1,4 @@
RSpec.describe 'Mutant on ruby corpus' do
RSpec.describe 'Mutant on ruby corpus', mutant: false do
before do
skip 'Corpus test is deactivated on < 2.1' if RUBY_VERSION < '2.1'

View file

@ -1,4 +1,4 @@
RSpec.describe 'null integration' do
RSpec.describe 'null integration', mutant: false do
let(:base_cmd) { 'bundle exec mutant -I lib --require test_app "TestApp*"' }

View file

@ -1,4 +1,4 @@
RSpec.describe 'rspec integration' do
RSpec.describe 'rspec integration', mutant: false do
let(:base_cmd) { 'bundle exec mutant -I lib --require test_app --use rspec' }

View file

@ -1,4 +1,4 @@
RSpec.describe do
RSpec.describe 'AST type coverage', mutant: false do
specify 'mutant should not crash for any node parser can generate' do
Mutant::AST::Types::ALL.each do |type|

View file

@ -1,4 +1,4 @@
RSpec.describe 'as a zombie' do
RSpec.describe 'as a zombie', mutant: false do
specify 'it allows to create zombie from mutant' do
expect { Mutant.zombify }.to change { defined?(Zombie) }.from(nil).to('constant')
expect(Zombie.constants).to include(:Mutant)