diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 5162e2f1d..0ce94ff64 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -20,7 +20,7 @@ object Dependencies { def metacp = "org.scalameta" %% "metacp" % scalametaV def semanticdbPluginLibrary = "org.scalameta" % "semanticdb-scalac-core" % scalametaV cross CrossVersion.full def scalameta = "org.scalameta" %% "scalameta" % scalametaV - def scalatest = "org.scalatest" %% "scalatest" % "3.0.8" + def scalatest = "org.scalatest" %% "scalatest" % "3.1.0" def scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.2" def testsDeps = List( diff --git a/scalafix-testkit/src/main/scala/scalafix/testkit/DiffAssertions.scala b/scalafix-testkit/src/main/scala/scalafix/testkit/DiffAssertions.scala index db3525747..9e7fad19d 100644 --- a/scalafix-testkit/src/main/scala/scalafix/testkit/DiffAssertions.scala +++ b/scalafix-testkit/src/main/scala/scalafix/testkit/DiffAssertions.scala @@ -5,8 +5,8 @@ import java.text.SimpleDateFormat import java.util.Date import java.util.TimeZone -import org.scalatest.FunSuiteLike import org.scalatest.exceptions.TestFailedException +import org.scalatest.funsuite.AnyFunSuiteLike object DiffAssertions { def compareContents(original: String, revised: String): String = { @@ -34,7 +34,7 @@ object DiffAssertions { } } -trait DiffAssertions extends FunSuiteLike { +trait DiffAssertions extends AnyFunSuiteLike { def assertEqual[A](a: A, b: A): Unit = { assert(a === b) diff --git a/scalafix-testkit/src/main/scala/scalafix/testkit/SemanticRuleSuite.scala b/scalafix-testkit/src/main/scala/scalafix/testkit/SemanticRuleSuite.scala index 10f960d48..23475071a 100644 --- a/scalafix-testkit/src/main/scala/scalafix/testkit/SemanticRuleSuite.scala +++ b/scalafix-testkit/src/main/scala/scalafix/testkit/SemanticRuleSuite.scala @@ -2,7 +2,6 @@ package scalafix.testkit import java.nio.charset.StandardCharsets import org.scalatest.BeforeAndAfterAll -import org.scalatest.FunSuite import org.scalatest.exceptions.TestFailedException import scala.meta._ import scala.meta.internal.io.FileIO @@ -14,12 +13,13 @@ import scalafix.internal.testkit.EndOfLineAssertExtractor import scalafix.internal.testkit.MultiLineAssertExtractor import scalafix.v0.SemanticdbIndex import java.nio.file.Files +import org.scalatest.funsuite.AnyFunSuite /** Construct a test suite for running semantic Scalafix rules. */ abstract class SemanticRuleSuite( val props: TestkitProperties, val isSaveExpect: Boolean -) extends FunSuite +) extends AnyFunSuite with DiffAssertions with BeforeAndAfterAll { self => diff --git a/scalafix-testkit/src/main/scala/scalafix/testkit/SyntacticRuleSuite.scala b/scalafix-testkit/src/main/scala/scalafix/testkit/SyntacticRuleSuite.scala index 8ce82d80a..5647f5650 100644 --- a/scalafix-testkit/src/main/scala/scalafix/testkit/SyntacticRuleSuite.scala +++ b/scalafix-testkit/src/main/scala/scalafix/testkit/SyntacticRuleSuite.scala @@ -1,17 +1,17 @@ package scalafix.testkit -import org.scalatest.FunSuiteLike import org.scalatest.Tag import scala.meta._ import scalafix.syntax._ import scalafix.v0._ +import org.scalatest.funsuite.AnyFunSuiteLike /** Utility to unit test syntactic rules * * @param rule the default rule to use from `check`/`checkDiff`. */ class SyntacticRuleSuite(rule: Rule = Rule.empty) - extends FunSuiteLike + extends AnyFunSuiteLike with DiffAssertions { def check(name: String, original: String, expected: String): Unit = {