Skip to content

Commit

Permalink
Update scalatest dependency to v.3.1.0 (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
tperek authored and raboof committed Dec 5, 2019
1 parent 676d512 commit 74109b8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object Dependencies {
val akkaActor = "com.typesafe.akka" %% "akka-actor" % "2.5.25"
val sprayJson = "io.spray" %% "spray-json" % "1.3.5"
val jsonLenses = "net.virtual-void" %% "json-lenses" % "0.6.2"
val scalatest = "org.scalatest" %% "scalatest" % "3.0.8"
val scalatest = "org.scalatest" %% "scalatest" % "3.1.0"
// format: ON

// Dependency scoping functions
Expand Down
4 changes: 3 additions & 1 deletion stamina-core/src/test/scala/stamina/StaminaSpec.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package stamina

import org.scalatest._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

abstract class StaminaSpec
extends WordSpecLike
extends AnyWordSpecLike
with Matchers
with OptionValues
with TryValues
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package stamina.json

import org.scalatest._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

abstract class StaminaJsonSpec
extends WordSpecLike
extends AnyWordSpecLike
with Matchers
with OptionValues
with TryValues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.Base64

import scala.util._

trait StaminaTestKit { self: org.scalatest.WordSpecLike =>
trait StaminaTestKit { self: org.scalatest.wordspec.AnyWordSpecLike =>

val defaultSampleId = "default"
case class PersistableSample[FromVersion <: Version: VersionInfo](sampleId: String, persistable: AnyRef, description: Option[String]) {
Expand All @@ -20,7 +20,7 @@ trait StaminaTestKit { self: org.scalatest.WordSpecLike =>
def sample(sampleId: String, persistable: AnyRef) = new PersistableSample[V1](sampleId, persistable, Some(sampleId))
def sample(sampleId: String, persistable: AnyRef, description: String) = new PersistableSample[V1](sampleId, persistable, Some(description))

implicit class TestablePersisters(persisters: Persisters) extends org.scalatest.Matchers {
implicit class TestablePersisters(persisters: Persisters) extends org.scalatest.matchers.should.Matchers {
def generateTestsFor(samples: PersistableSample[_]*): Unit = {
samples.foreach { sample =>
generateRoundtripTestFor(sample)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import java.io.File
import org.scalatest._
import org.scalatest.events._
import org.scalatest.matchers.{ BePropertyMatchResult, BePropertyMatcher }
import org.scalatest.wordspec.AnyWordSpecLike

import scala.reflect.ClassTag

Expand All @@ -20,7 +21,7 @@ class ScalatestTestGenerationSpec extends StaminaTestKitSpec {

"A spec generated by StaminaTestKit" when {
"there is only version 1" should {
val spec = new StaminaTestKit with WordSpecLike {
val spec = new StaminaTestKit with AnyWordSpecLike {
val persisters = Persisters(ItemPersister("item1"))
"TestDomainSerialization" should {
persisters.generateTestsFor(
Expand Down Expand Up @@ -66,7 +67,7 @@ class ScalatestTestGenerationSpec extends StaminaTestKitSpec {
}

"the sample is only suitable for version 2 and up" should {
val spec = new StaminaTestKit with WordSpecLike {
val spec = new StaminaTestKit with AnyWordSpecLike {
val persisters = Persisters(ItemPersister("item2"))
"TestDomainSerialization" should {
persisters.generateTestsFor(
Expand All @@ -86,7 +87,7 @@ class ScalatestTestGenerationSpec extends StaminaTestKitSpec {
}

"a sample is available for both version 1 and (the migrated event) version 2" should {
val spec = new StaminaTestKit with WordSpecLike {
val spec = new StaminaTestKit with AnyWordSpecLike {
val persisters = Persisters(ItemPersister("item1"))
"TestDomainSerialization" should {
persisters.generateTestsFor(
Expand All @@ -108,7 +109,7 @@ class ScalatestTestGenerationSpec extends StaminaTestKitSpec {
}
}

private def execSpec(spec: WordSpecLike): EventRecordingReporter = {
private def execSpec(spec: AnyWordSpecLike): EventRecordingReporter = {
val myRep = new EventRecordingReporter
spec.run(None, Args(myRep, Stopper.default, Filter(), ConfigMap.empty, None, new Tracker, Set.empty))
myRep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package stamina
package testkit

import org.scalatest._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

abstract class StaminaTestKitSpec
extends WordSpecLike
extends AnyWordSpecLike
with Matchers
with OptionValues
with TryValues
Expand Down

0 comments on commit 74109b8

Please sign in to comment.