Skip to content

Commit

Permalink
[Build] Bump scalatest version (#327)
Browse files Browse the repository at this point in the history
* [Build] Bump scalatest version

* Fix imports and extensions

Signed-off-by: lloydmeta <[email protected]>
  • Loading branch information
lloydmeta authored Jul 22, 2021
1 parent fba99ba commit 87c4096
Show file tree
Hide file tree
Showing 35 changed files with 117 additions and 71 deletions.
11 changes: 8 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ lazy val scalaVersionsAll = Seq(scala_2_11Version, scala_2_12Version, scala_2_1

lazy val theScalaVersion = scala_2_12Version

lazy val scalaTestVersion = "3.1.1"
lazy val scalacheckVersion = "1.14.3"
lazy val scalaTestVersion = "3.2.9"

// Library versions
lazy val reactiveMongoVersion = "1.0.0"
Expand Down Expand Up @@ -72,6 +71,12 @@ def theCirceVersion(scalaVersion: String) =
throw new IllegalArgumentException(s"Unsupported Scala version $scalaVersion")
}

def theScalacheckVersion(scalaVersion: String) =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, 11)) => "1.15.2"
case _ => "1.15.4"
}

def scalaTestPlay(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match {
case Some((2, scalaMajor)) if scalaMajor >= 12 =>
"org.scalatestplus.play" %% "scalatestplus-play" % "5.0.0" % Test
Expand Down Expand Up @@ -407,7 +412,7 @@ lazy val enumeratumScalacheck = crossProject(JSPlatform, JVMPlatform)
libraryDependencies ++= {
Seq(
"com.beachape" %%% "enumeratum" % Versions.Core.stable,
"org.scalacheck" %%% "scalacheck" % scalacheckVersion,
"org.scalacheck" %%% "scalacheck" % theScalacheckVersion(scalaVersion.value),
"org.scalatestplus" %%% "scalacheck-1-14" % "3.1.1.1" % Test,
"com.beachape" %%% "enumeratum-test" % Versions.Core.stable % Test
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package enumeratum

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

import argonaut._
import Argonaut._

/** Created by alonsodomin on 14/10/2016.
*/
class ArgonautSpec extends FunSpec with Matchers {
class ArgonautSpec extends AnyFunSpec with Matchers {

describe("to JSON") {
it("should work") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package enumeratum.values

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import argonaut._
import Argonaut._

/** Created by alonsodomin on 14/10/2016.
*/
class ArgonautValueEnumSpec extends FunSpec with Matchers {
class ArgonautValueEnumSpec extends AnyFunSpec with Matchers {

testArgonautEnum("LongArgonautEnum", ArgonautMediaType)
testArgonautEnum("IntArgonautEnum", ArgonautJsonLibs)
Expand Down
6 changes: 4 additions & 2 deletions enumeratum-cats/src/test/scala/enumeratum/CatsEnumSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import cats.{Eq, Hash, Show}
import cats.syntax.eq._
import cats.syntax.show._
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{BeforeAndAfterAll, FreeSpec, Matchers}
import org.scalatest.BeforeAndAfterAll
import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers

class CatsEnumSpec extends FreeSpec with ScalaFutures with Matchers with BeforeAndAfterAll {
class CatsEnumSpec extends AnyFreeSpec with ScalaFutures with Matchers with BeforeAndAfterAll {

"CatsEnum" - {
"has a proper Eq instance" - {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import cats.Order
import cats.instances.int._
import cats.syntax.order._
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{FreeSpec, Matchers}
import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers

class CatsOrderValueEnumSpec extends FreeSpec with ScalaFutures with Matchers {
class CatsOrderValueEnumSpec extends AnyFreeSpec with ScalaFutures with Matchers {

"CatsOrderedValueEnum" - {
"has a proper Order instance" - {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import cats.syntax.eq._
import cats.syntax.show._
import cats.{Eq, Show}
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{FreeSpec, Matchers}
import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers

class CatsValueEnumSpec extends FreeSpec with ScalaFutures with Matchers {
class CatsValueEnumSpec extends AnyFreeSpec with ScalaFutures with Matchers {

"CatsValueEnum" - {
"has a proper Eq instance" - {
Expand Down
5 changes: 3 additions & 2 deletions enumeratum-circe/src/test/scala/enumeratum/CirceKeySpec.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package enumeratum

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import cats.syntax.either._
import io.circe.Json
import io.circe.syntax._

class CirceKeySpec extends FunSpec with Matchers {
class CirceKeySpec extends AnyFunSpec with Matchers {
describe("to JSON") {
it("should work") {
Map(ShirtSize.Small -> 5, ShirtSize.Large -> 10).asJson shouldBe Json.obj(
Expand Down
5 changes: 3 additions & 2 deletions enumeratum-circe/src/test/scala/enumeratum/CirceSpec.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package enumeratum

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import cats.syntax.either._
import io.circe.Json
import io.circe.syntax._
Expand All @@ -9,7 +10,7 @@ import io.circe.syntax._
*
* Copyright 2016
*/
class CirceSpec extends FunSpec with Matchers {
class CirceSpec extends AnyFunSpec with Matchers {

describe("to JSON") {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package enumeratum.values

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import cats.syntax.either._
import io.circe.{Decoder, Encoder, KeyDecoder, KeyEncoder, Json}
import io.circe.syntax._
Expand All @@ -9,7 +10,7 @@ import io.circe.syntax._
*
* Copyright 2016
*/
class CirceValueEnumSpec extends FunSpec with Matchers {
class CirceValueEnumSpec extends AnyFunSpec with Matchers {

testCirceEnum("LongCirceEnum", CirceContentType)
testCirceEnum("ShortCirceEnum", CirceDrinks)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package enumeratum

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

class EnumJVMSpec extends FunSpec with Matchers {
class EnumJVMSpec extends AnyFunSpec with Matchers {

describe("findValues Vector") {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package enumeratum.values

import enumeratum.Eval
import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

import scala.reflect.ClassTag
import scala.util.Random
Expand All @@ -10,7 +11,7 @@ import scala.util.Random
*
* Copyright 2016
*/
class ValueEnumJVMSpec extends FunSpec with Matchers {
class ValueEnumJVMSpec extends AnyFunSpec with Matchers {

private def stringGenerator =
Random.alphanumeric.grouped(10).toStream.map(_.mkString.replaceAll("[0-9]", "")).distinct
Expand Down
5 changes: 3 additions & 2 deletions enumeratum-core/src/test/scala/enumeratum/EnumSpec.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package enumeratum

import org.scalatest.OptionValues._
import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

class EnumSpec extends FunSpec with Matchers {
class EnumSpec extends AnyFunSpec with Matchers {

describe("no values") {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package enumeratum.values

import java.util.NoSuchElementException

import org.scalatest._
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

/** Created by Lloyd on 4/13/16.
*
* Copyright 2016
*/
trait ValueEnumHelpers { this: FunSpec with Matchers =>
trait ValueEnumHelpers { this: AnyFunSpec with Matchers =>

/*
* Generates tests for a given enum and groups the tests inside the given enumKind descriptor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package enumeratum.values

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

/** Created by Lloyd on 4/12/16.
*
* Copyright 2016
*/
class ValueEnumSpec extends FunSpec with Matchers with ValueEnumHelpers {
class ValueEnumSpec extends AnyFunSpec with Matchers with ValueEnumHelpers {

describe("basic sanity check") {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package enumeratum

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

import doobie.util.{Read => DoobieRead, Write => DoobieWrite}
import scala.collection.immutable

class DoobieEnumSpec extends FunSpec with Matchers {
class DoobieEnumSpec extends AnyFunSpec with Matchers {

describe("A DoobieEnum") {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package enumeratum.values

import cats.effect.{IO, Resource}
import doobie.util.{Read => DoobieRead, Write => DoobieWrite}
import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import scala.concurrent.Future
import scala.concurrent.ExecutionContext
import scala.collection.immutable
import java.util.concurrent.{Executors, ExecutorService}

class DoobieValueEnumSpec extends FunSpec with Matchers {
class DoobieValueEnumSpec extends AnyFunSpec with Matchers {

describe("An IntDoobieEnum") {

Expand Down
5 changes: 3 additions & 2 deletions enumeratum-json4s/src/test/scala/enumeratum/Json4sSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package enumeratum

import org.json4s.{DefaultFormats, MappingException}
import org.json4s.native.Serialization
import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

class Json4sSpec extends FunSpec with Matchers {
class Json4sSpec extends AnyFunSpec with Matchers {

implicit val formats =
DefaultFormats + Json4s.serializer(TrafficLight) + Json4s.keySerializer(TrafficLight)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package enumeratum.values
import org.json4s.{DefaultFormats, JObject, MappingException}
import org.json4s.JsonDSL._
import org.json4s.native.Serialization
import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

class Json4sValueEnumSpec extends FunSpec with Matchers {
class Json4sValueEnumSpec extends AnyFunSpec with Matchers {

implicit val formats = DefaultFormats +
Json4s.serializer(Json4sMediaType) + Json4s.serializer(Json4sJsonLibs) +
Expand Down
5 changes: 3 additions & 2 deletions enumeratum-play/src/test/scala/enumeratum/FormSpec.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package enumeratum

import org.scalatest._
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import play.api.data.Form
import org.scalatest.OptionValues._

/** Created by Lloyd on 2/3/15.
*/
class FormSpec extends FunSpec with Matchers {
class FormSpec extends AnyFunSpec with Matchers {

import Forms._

Expand Down
5 changes: 3 additions & 2 deletions enumeratum-play/src/test/scala/enumeratum/PlayEnumSpec.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package enumeratum

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import play.api.data.{Form, Mapping}
import play.api.http.HttpVerbs
import play.api.libs.json.{Format, JsNumber, JsString, JsValue, Json => PlayJson}
Expand All @@ -11,7 +12,7 @@ import play.api.routing.sird.PathBindableExtractor
import play.api.test.FakeRequest
import enumeratum.helpers.ActionHelper

class PlayEnumSpec extends FunSpec with Matchers {
class PlayEnumSpec extends AnyFunSpec with Matchers {

testScenarios(
descriptor = "ordinary operation (no tarnsforms)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package enumeratum

import UrlBinders._
import org.scalatest._
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.OptionValues._
import org.scalatest.EitherValues._

/** Created by Lloyd on 2/3/15.
*/
class UrlBindersSpec extends FunSpec with Matchers {
class UrlBindersSpec extends AnyFunSpec with Matchers {

describe(".pathBinder") {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package enumeratum.values

import org.scalatest._
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import play.api.data.Form
import play.api.http.HttpVerbs
import org.scalatest.OptionValues._
Expand All @@ -13,7 +14,7 @@ import enumeratum.helpers.ActionHelper
*
* Copyright 2016
*/
trait PlayValueEnumHelpers extends EnumJsonFormatHelpers { this: FunSpec with Matchers =>
trait PlayValueEnumHelpers extends EnumJsonFormatHelpers { this: AnyFunSpec with Matchers =>

def testNumericPlayEnum[EntryType <: ValueEnumEntry[
ValueType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package enumeratum.values

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import play.api.libs.json.{JsNumber, JsString}
import EnumFormats.charFormat

/** Created by Lloyd on 4/13/16.
*
* Copyright 2016
*/
class PlayValueEnumSpec extends FunSpec with Matchers with PlayValueEnumHelpers {
class PlayValueEnumSpec extends AnyFunSpec with Matchers with PlayValueEnumHelpers {

testNumericPlayEnum("LongPlayEnum", PlayContentType)
testNumericPlayEnum("ShortPlayEnum", PlayDrinks)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package enumeratum

import org.scalatest.{FunSpec, Matchers}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

import scala.collection.immutable

class QuillEnumSpec extends FunSpec with Matchers {
class QuillEnumSpec extends AnyFunSpec with Matchers {

describe("A QuillEnum") {

Expand Down
Loading

0 comments on commit 87c4096

Please sign in to comment.