[sync] add test for s3client objecthead thunking

This commit is contained in:
Paul Campbell 2019-05-08 08:59:29 +01:00
parent 387904d1af
commit f099765dd3

View file

@ -0,0 +1,22 @@
package net.kemitix.s3thorp
import java.time.Instant
import cats.effect.IO
import org.scalatest.FunSpec
class SyncSuite extends FunSpec {
describe("s3client thunk") {
val hash = "hash"
val lastModified = Instant.now()
val sync = new Sync(new S3Client {
override def objectHead(bucket: String, key: String) = IO((hash, lastModified))
})
describe("objectHead") {
it("return the hash and lastModified expected") {
assertResult((hash, lastModified))(sync.objectHead("", "").unsafeRunSync())
}
}
}
}