diff --git a/spec/tooling/lib/tooling/test_file_finder_spec.rb b/spec/tooling/lib/tooling/test_file_finder_spec.rb index a56600709c6cd93fa06716a9070575e87bbfe6da..aec33940b28d0f5c2533bd53b1e189ce632bf3ae 100644 --- a/spec/tooling/lib/tooling/test_file_finder_spec.rb +++ b/spec/tooling/lib/tooling/test_file_finder_spec.rb @@ -54,11 +54,11 @@ end end - context 'when given a module file in ee/' do + context 'when given an ee extension module file' do let(:file) { 'ee/app/models/ee/user.rb' } - it 'returns the matching ee/ module test file and the ee/ model test file' do - test_files = ['ee/spec/models/ee/user_spec.rb', 'spec/app/models/user_spec.rb'] + it 'returns the matching ee/ class test file, ee extension module test file and the foss class test file' do + test_files = ['ee/spec/models/user_spec.rb', 'ee/spec/models/ee/user_spec.rb', 'spec/app/models/user_spec.rb'] expect(subject.test_files).to contain_exactly(*test_files) end end diff --git a/tooling/lib/tooling/test_file_finder.rb b/tooling/lib/tooling/test_file_finder.rb index 24ea9ed4a8494c8c2529ac6fa32ab48fd79fa92b..2a61a9b8c804f588d5e8d4d4e79c22949c531ce4 100644 --- a/tooling/lib/tooling/test_file_finder.rb +++ b/tooling/lib/tooling/test_file_finder.rb @@ -48,6 +48,7 @@ def ee_matcher TestFileMatcher.new do |matcher| unless foss_test_only matcher.associate(%r{^#{EE_PREFIX}app/(.+)\.rb$}) { |match| "#{EE_PREFIX}spec/#{match[1]}_spec.rb" } + matcher.associate(%r{^#{EE_PREFIX}app/(.*\/)ee/(.+)\.rb$}) { |match| "#{EE_PREFIX}spec/#{match[1]}#{match[2]}_spec.rb" } matcher.associate(%r{^#{EE_PREFIX}lib/(.+)\.rb$}) { |match| "#{EE_PREFIX}spec/lib/#{match[1]}_spec.rb" } matcher.associate(%r{^#{EE_PREFIX}spec/(.+)_spec.rb$}) { |match| match[0] } end