Existing data for tests is not found Scala Specs2

I have tried to change the way I read files. Turns out reading from resources might produce this error as the contents are read before all the tests. Although when I read the data simply from the directory, the contents get updated and this error does not occur. This is the way I have changed the tests:

"write results to the resources" in {
  val resultsPath = "./src/dockerise/resource/results/loader_result"
  resourcesDirectoryIsEmpty(resultsPath) must beFalse
}