@@ -12,7 +12,7 @@ import scala.util.{Failure, Try}
1212class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatchers {
1313
1414 private val filledDirPath : File = FileUtil .getResource(" fileTests/filledDir" )
15- private val basePath : File = filledDirPath / " src/main/scala/package "
15+ private val basePath : File = filledDirPath / " src/main/scala"
1616
1717 assume(filledDirPath.exists(), " Filled test dir does not exist" )
1818 assume(basePath.exists(), " Basepath dir does not exist" )
@@ -40,8 +40,8 @@ class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatcher
4040
4141 val results = sut.collectFilesToMutate()
4242
43- results should have size 3
44- results should contain only (basePath / " someFile.scala" , basePath / " secondFile.scala" , basePath / " target.scala" )
43+ results should have size 4
44+ results should contain only (basePath / " fileInRootSourceDir.scala " , basePath / " package " / " someFile.scala" , basePath / " package " / " secondFile.scala" , basePath / " package " / " target.scala" )
4545 }
4646
4747 it(" should find matching files with custom config match pattern" ) {
@@ -52,7 +52,7 @@ class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatcher
5252 val results = sut.collectFilesToMutate()
5353 val onlyResult = results.loneElement
5454
55- onlyResult should equal(basePath / " secondFile.scala" )
55+ onlyResult should equal(basePath / " package " / " secondFile.scala" )
5656 }
5757
5858 it(" should find no matches with a non-matching glob" ) {
@@ -73,18 +73,18 @@ class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatcher
7373 val results = sut.collectFilesToMutate()
7474
7575 results should have size 2
76- results should contain only (basePath / " someFile.scala" , basePath / " secondFile.scala" )
76+ results should contain only (basePath / " package " / " someFile.scala" , basePath / " package " / " secondFile.scala" )
7777 }
7878
7979 it(" should only add a glob once even when it matches twice" ) {
8080 implicit val config : Config =
81- Config (mutate = Seq (" **/someFile.scala" , " **/*.scala" ), baseDir = filledDirPath)
81+ Config (mutate = Seq (" **/someFile.scala" , " src/main/scala/ **/*.scala" ), baseDir = filledDirPath)
8282 val sut = new FileCollector (TestProcessRunner ())
8383
8484 val results = sut.collectFilesToMutate()
8585
8686 results should have size 3
87- results should contain only (basePath / " someFile.scala" , basePath / " secondFile.scala" , basePath / " target.scala" )
87+ results should contain only (basePath / " package " / " someFile.scala" , basePath / " package " / " secondFile.scala" , basePath / " package " / " target.scala" )
8888 }
8989
9090 it(" should not find a file twice when the patterns match on the same file twice" ) {
@@ -110,7 +110,7 @@ class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatcher
110110 val results = sut.collectFilesToMutate()
111111
112112 results should have size 1
113- results should contain only (basePath / " secondFile.scala" )
113+ results should contain only (basePath / " package " / " secondFile.scala" )
114114 }
115115
116116 it(" Should exclude all files specified in the excluded files config" ) {
@@ -145,8 +145,8 @@ class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatcher
145145
146146 val results = sut.collectFilesToMutate()
147147
148- results should have size 3
149- results should contain only (basePath / " someFile.scala" , basePath / " secondFile.scala" , basePath / " target.scala" )
148+ results should have size 4
149+ results should contain only (basePath / " fileInRootSourceDir.scala " , basePath / " package " / " someFile.scala" , basePath / " package " / " secondFile.scala" , basePath / " package " / " target.scala" )
150150 }
151151
152152 it(" Should not exclude a non existing file" ) {
@@ -160,7 +160,7 @@ class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatcher
160160 val results = sut.collectFilesToMutate()
161161
162162 results should have size 2
163- results should contain only (basePath / " someFile.scala" , basePath / " secondFile.scala" )
163+ results should contain only (basePath / " package " / " someFile.scala" , basePath / " package " / " secondFile.scala" )
164164 }
165165 }
166166 }
@@ -202,7 +202,9 @@ class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatcher
202202 it(" Should copy the files from the files config key" ) {
203203 implicit val config : Config =
204204 Config (baseDir = filledDirPath, files = Some (Seq (" **/main/scala/**/*.scala" )))
205- val expectedFileList = Seq (basePath / " someFile.scala" , basePath / " secondFile.scala" , basePath / " target.scala" )
205+ val expectedFileList = Seq (basePath / " package" / " someFile.scala" ,
206+ basePath / " package" / " secondFile.scala" ,
207+ basePath / " package" / " target.scala" )
206208
207209 val sut = new FileCollector (processRunnerMock)
208210
@@ -213,12 +215,12 @@ class FileCollectorTest extends Stryker4sSuite with MockitoSuite with LogMatcher
213215
214216 it(
215217 " Should copy files out of the target folders when no files config key is found and target repo is not a git repo" ) {
216- implicit val config : Config = Config (baseDir = basePath, files = None )
218+ implicit val config : Config = Config (baseDir = basePath / " package " , files = None )
217219 val expectedFileList =
218- Seq (basePath / " someFile.scala" ,
219- basePath / " secondFile.scala" ,
220- basePath / " otherFile.notScala" ,
221- basePath / " target.scala" )
220+ Seq (basePath / " package " / " someFile.scala" ,
221+ basePath / " package " / " secondFile.scala" ,
222+ basePath / " package " / " otherFile.notScala" ,
223+ basePath / " package " / " target.scala" )
222224 val gitProcessResult = Failure (new Exception (" Exception" ))
223225 when(processRunnerMock(any[Command ], any[File ])).thenReturn(gitProcessResult)
224226
0 commit comments