Special treatment for Noop mutations

Otherwise mutant would run all matched example groups for a noop when it
only makes sense to run the first match
This commit is contained in:
Piotr Solnica 2013-08-07 23:31:05 +02:00
parent 26392b0392
commit 868dd0846c

View file

@ -20,7 +20,12 @@ module Mutant
def run
mutation.insert
groups = example_groups
groups =
if mutation.is_a?(Mutation::Neutral::Noop)
[example_groups.first]
else
example_groups
end
unless groups
$stderr.puts("No rspec example groups found for: #{match_prefixes.join(', ')}")