Fix test selection scope expansion

Restores the pre expression based test selection since the change was
unintentional made.
This commit is contained in:
Markus Schirp 2014-06-28 22:31:29 +00:00
parent 5cc4f28ace
commit 86d6a561f8
3 changed files with 5 additions and 5 deletions

View file

@ -97,7 +97,7 @@ module Mutant
# #
def match_expressions def match_expressions
name_nesting.each_index.reverse_each.map do |index| name_nesting.each_index.reverse_each.map do |index|
Expression.parse_strict(name_nesting.take(index.succ).join(NAMESPACE_DELIMITER)) Expression.parse_strict("#{name_nesting.take(index.succ).join(NAMESPACE_DELIMITER)}*")
end end
end end
memoize :match_expressions memoize :match_expressions

View file

@ -73,7 +73,7 @@ module Mutant
def tests(subject) def tests(subject)
subject.match_expressions.each do |match_expression| subject.match_expressions.each do |match_expression|
tests = all_tests.select do |test| tests = all_tests.select do |test|
test.expression.prefix?(match_expression) match_expression.prefix?(test.expression)
end end
return tests if tests.any? return tests if tests.any?
end end

View file

@ -3,8 +3,8 @@ require 'spec_helper'
describe Mutant::Subject do describe Mutant::Subject do
let(:class_under_test) do let(:class_under_test) do
Class.new(described_class) do Class.new(described_class) do
def match_expression def expression
'match' Mutant::Expression.parse('Test')
end end
end end
end end
@ -34,6 +34,6 @@ describe Mutant::Subject do
describe '#identification' do describe '#identification' do
subject { object.identification } subject { object.identification }
it { should eql('match:source_path:source_line') } it { should eql('Test:source_path:source_line') }
end end
end end