forked from whisklabs/docker-it-scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Testkit
Dmytro Mykhalyk edited this page Nov 28, 2017
·
2 revisions
There are two testkits available -- one for scalatest
and one for
specs2
.
Both set up the necessary docker containers and check that they are ready BEFORE any test is run, and doesn't close the container until ALL the tests are run.
class MyMongoSpec extends FlatSpec with Matchers with DockerMongodbService {
...
}
class AllAtOnceSpec extends FlatSpec with Matchers with BeforeAndAfterAll with GivenWhenThen with ScalaFutures
with DockerElasticsearchService with DockerCassandraService with DockerNeo4jService with DockerMongodbService {
implicit val pc = PatienceConfig(Span(20, Seconds), Span(1, Second))
"all containers" should "be ready at the same time" in {
dockerContainers.map(_.image).foreach(println)
dockerContainers.forall(_.isReady().futureValue) shouldBe true
}
}
Examples can be found in the specs2 module's tests