Fix glob for #initialize to use the proper format

* The previous statement would not match any files at all.
This commit is contained in:
Dan Kubb 2013-06-23 23:39:26 -07:00
parent 6a96062153
commit e656718375
3 changed files with 7 additions and 6 deletions

View file

@ -1,3 +1,3 @@
--- ---
threshold: 16 threshold: 16
total_score: 614 total_score: 607

View file

@ -106,11 +106,12 @@ module Mutant
# @api private # @api private
# #
def glob_expression def glob_expression
glob_expression = super
if method_name == :initialize and !public? if method_name == :initialize and !public?
return "#{private_glob_expression} #{base_path}/class_methods/new_spec.rb" "{#{glob_expression},#{base_path}/class_methods/new_spec.rb}"
else
glob_expression
end end
super
end end
end # Instance end # Instance

View file

@ -43,7 +43,7 @@ describe Mutant::Strategy::Rspec::DM2::Lookup::Method::Instance, '#spec_files' d
context 'initialize' do context 'initialize' do
let(:method_name) { :initialize } let(:method_name) { :initialize }
let(:expected_glob_expression) { 'spec/unit/foo/*_spec.rb spec/unit/foo/class_methods/new_spec.rb' } let(:expected_glob_expression) { '{spec/unit/foo/*_spec.rb,spec/unit/foo/class_methods/new_spec.rb}' }
it_should_behave_like this_example_group it_should_behave_like this_example_group
end end