Skip to content

Commit 2ec2c2f

Browse files
committed
upgrade to ScalaTest 3.1
and avoid deprecated stuff, to pave the way for moving to 3.2
1 parent 0be7a97 commit 2ec2c2f

File tree

8 files changed

+17
-26
lines changed

8 files changed

+17
-26
lines changed

Diff for: build.sbt

+1-9
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@ ThisBuild / homepage := Some(url("https://github.com/oleg-py/better-monadic-for")
1313
ThisBuild / scalaVersion := Option(System.getenv("SCALA_VERSION")).filter(_.nonEmpty).getOrElse(scala213)
1414

1515
val testSettings = Seq(
16-
libraryDependencies ++= Seq(
17-
CrossVersion.partialVersion(scalaVersion.value) match {
18-
case Some((2, 13)) =>
19-
// bincompatible enough :)
20-
"org.scalatest" % "scalatest_2.13.0-RC3" % "3.1.0-SNAP12" % Test
21-
case _ => "org.scalatest" %% "scalatest" % "3.1.0-SNAP12" % Test
22-
}
23-
24-
),
16+
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
2517
Test / scalacOptions ++= {
2618
val jar = (betterMonadicFor / Compile / packageBin).value
2719
Seq(s"-Xplugin:${jar.getAbsolutePath}", s"-Jdummy=${jar.lastModified}") // ensures recompile

Diff for: cats-tests/src/test/scala/com/olegpy/bm4/CatsSyntaxTest.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.olegpy.bm4
22

33
import cats.Monad
4-
import org.scalatest.FreeSpec
4+
import org.scalatest.freespec.AnyFreeSpec
55
import cats.implicits._
66

7-
class CatsSyntaxTest extends FreeSpec {
7+
class CatsSyntaxTest extends AnyFreeSpec {
88
implicit val mcCatsInstance: cats.FlatMap[MapCheck] = new cats.FlatMap[MapCheck] {
99
def flatMap[A, B](fa: MapCheck[A])(f: A => MapCheck[B]): MapCheck[B] = {
1010
fa.flatMap(f)

Diff for: pcplod-tests/src/test/scala/com/olegpy/bm4/PresentationCompiler.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.olegpy.bm4
22

33
import org.ensime.pcplod._
4-
import org.scalatest.FreeSpec
4+
import org.scalatest.freespec.AnyFreeSpec
55

6-
class PresentationCompiler extends FreeSpec {
6+
class PresentationCompiler extends AnyFreeSpec {
77
"PC should have no errors" in {
88
withMrPlod("Arrows.scala") { pc =>
99
assert(pc.messages.isEmpty)

Diff for: plugin-tests/src/test/scala/com/olegpy/bm4/TestFor.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.olegpy.bm4
33
import scala.concurrent.Future
44
import scala.concurrent.duration.Duration
55

6-
import org.scalatest.{FreeSpec, FunSuite}
6+
import org.scalatest.freespec.AnyFreeSpec
77

88
/** Mo is a lazy monad without `withFilter` */
99
sealed trait Mo[A] {
@@ -26,7 +26,7 @@ object Mo {
2626
val unit: Mo[Unit] = Mo(())
2727
}
2828

29-
class TestFor extends FreeSpec {
29+
class TestFor extends AnyFreeSpec {
3030

3131
"Plugin allows" - {
3232
"destructuring for monads without withFilter" in {

Diff for: plugin-tests/src/test/scala/com/olegpy/bm4/TestImplicitPatterns.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.olegpy.bm4
22

3-
import org.scalatest.FreeSpec
3+
import org.scalatest.freespec.AnyFreeSpec
44

55
object CTTest {
66
def foo[A]: Mo[A] = for {
77
implicit0(a: A) <- Mo.delay(null.asInstanceOf[A])
88
} yield implicitly[A]
99
}
1010

11-
class TestImplicitPatterns extends FreeSpec {
11+
class TestImplicitPatterns extends AnyFreeSpec {
1212
case class ImplicitTest(id: String)
1313
def typed[A](a: A) = ()
1414
case class ImplicitTest2(id: String)

Diff for: plugin-tests/src/test/scala/com/olegpy/bm4/TestNoMap.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.olegpy.bm4
22

3-
import org.scalatest.FreeSpec
3+
import org.scalatest.freespec.AnyFreeSpec
44

55
case class MapCalled() extends Exception
66

@@ -9,7 +9,7 @@ class MapCheck[+A](a: A) {
99
def flatMap[B](f: A => MapCheck[B]): MapCheck[B] = f(a)
1010
}
1111

12-
class TestNoMap extends FreeSpec {
12+
class TestNoMap extends AnyFreeSpec {
1313
"emits no map(b => b) in for-comprehension" in {
1414
for {
1515
_ <- new MapCheck(42)

Diff for: plugin-tests/src/test/scala/com/olegpy/bm4/TestNoTuples.scala

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package com.olegpy.bm4
22

33
import com.olegpy.bm4.TestNoTuples.TupleChecker
4-
import org.scalatest.FreeSpec
4+
import org.scalatest.freespec.AnyFreeSpec
55

6-
7-
class TestNoTuples extends FreeSpec {
6+
class TestNoTuples extends AnyFreeSpec {
87
"Plugin removes tuples produced in binding" - {
98
"for single definition" in {
109
for {
@@ -147,4 +146,4 @@ object TestNoTuples {
147146
f(a)
148147
}
149148
}
150-
}
149+
}

Diff for: scalaz-tests/src/test/scala/com/olegpy/bm4/ScalazSyntaxTest.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.olegpy.bm4
22

3-
import org.scalatest.FreeSpec
3+
import org.scalatest.freespec.AnyFreeSpec
44
import scalaz._, Scalaz._
55

6-
class ScalazSyntaxTest extends FreeSpec {
6+
class ScalazSyntaxTest extends AnyFreeSpec {
77
implicit val scalazInstance: Bind[MapCheck] = new Bind[MapCheck] {
88
def bind[A, B](fa: MapCheck[A])(f: A => MapCheck[B]): MapCheck[B] = fa.flatMap(f)
99

@@ -19,4 +19,4 @@ class ScalazSyntaxTest extends FreeSpec {
1919

2020
sillyTest(new MapCheck(11), new MapCheck(42))
2121
}
22-
}
22+
}

0 commit comments

Comments
 (0)