[localfilestream] Compare test files within a Set (#11)

Fixes #10 

* [localfilestream] Compare test files within a Set

Removes issue of files being read in different orders.

* [localfilestream] add missing parameter type
This commit is contained in:
Paul Campbell 2019-05-16 19:59:06 +01:00 committed by GitHub
parent e834702923
commit 74afb288cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,7 @@
package net.kemitix.s3thorp
import java.io.File
import org.scalatest.FunSpec
class LocalFileStreamSuite extends FunSpec with LocalFileStream {
@ -7,9 +9,9 @@ class LocalFileStreamSuite extends FunSpec with LocalFileStream {
describe("streamDirectoryPaths") {
var uploadResource = Resource(this, "upload")
it("should find all files") {
val result: List[String] = streamDirectoryPaths(uploadResource).toList
.map(x=>uploadResource.toPath.relativize(x.toPath).toString)
assertResult(List("subdir/leaf-file", "root-file"))(result)
val result: Set[String] = streamDirectoryPaths(uploadResource).toSet
.map { x: File => uploadResource.toPath.relativize(x.toPath).toString }
assertResult(Set("subdir/leaf-file", "root-file"))(result)
}
}
}