Skip to content

Commit

Permalink
Update Scala Native, Scalatest, Scala, Sbt
Browse files Browse the repository at this point in the history
- Use modularized Scalatest
- Update sbt-crossproject
  • Loading branch information
lolgab committed Sep 28, 2020
1 parent 667c5f4 commit 17758bd
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 34 deletions.
20 changes: 7 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}

val Leaf = "0.1.0"
val Scala2_11 = "2.11.12"
val Scala2_12 = "2.12.8"
val Scala2_13 = "2.13.0"
val ScalaTest = "3.0.8"
val ScalaTestNative = "3.2.0-SNAP10"
val Scala2_12 = "2.12.12"
val Scala2_13 = "2.13.3"
val ScalaTest = "3.2.2"

val SharedSettings = Seq(
name := "trail",
Expand Down Expand Up @@ -51,19 +50,14 @@ lazy val trail = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(
autoAPIMappings := true,
apiMappings += (scalaInstance.value.libraryJar -> url(s"http://www.scala-lang.org/api/${scalaVersion.value}/")),
)
.jsSettings(
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTest % "test"
)
.jvmSettings(
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTest % "test"
libraryDependencies ++= Seq("freespec", "wordspec", "funspec", "funsuite", "shouldmatchers").map(module =>
"org.scalatest" %%% s"scalatest-$module" % ScalaTest % Test
)
).nativeSettings(
scalaVersion := Scala2_11,
crossScalaVersions := Seq(Scala2_11),
// See https://github.com/scalalandio/chimney/issues/78#issuecomment-419705142
nativeLinkStubs := true,
libraryDependencies +=
"org.scalatest" %%% "scalatest" % ScalaTestNative % "test"
Test / nativeLinkStubs := true
)

lazy val manual = project.in(file("manual"))
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.8
sbt.version=1.3.13
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
logLevel := Level.Warn

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0-M2")
4 changes: 2 additions & 2 deletions shared/src/test/scala/trail/PathTests.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package trail

import org.scalatest._
import org.scalatest.funsuite.AnyFunSuite

class PathTests extends FunSuite {
class PathTests extends AnyFunSuite {
test("Parse absolute URL") {
assert(PathParser.parse("http://example.com/test") == Path("/test"))
}
Expand Down
5 changes: 3 additions & 2 deletions shared/src/test/scala/trail/RouteDataTests.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package trail

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

class RouteDataTests extends WordSpec with Matchers {
class RouteDataTests extends AnyWordSpec with Matchers {
"A Route" when {
"empty" should {
"return root URL" in {
Expand Down
4 changes: 2 additions & 2 deletions shared/src/test/scala/trail/RouteEqualityTests.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package trail

import org.scalatest._
import org.scalatest.freespec.AnyFreeSpec

class RouteEqualityTests extends FreeSpec with Matchers {
class RouteEqualityTests extends AnyFreeSpec {
"A Route" - {
"cannot equal InstantiatedRoute" in {
val r1 = Root / "asdf"
Expand Down
4 changes: 2 additions & 2 deletions shared/src/test/scala/trail/RouteFragmentTests.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package trail

import org.scalatest._
import org.scalatest.funspec.AnyFunSpec
import trail.Route.ParamRoute0

class RouteFragmentTests extends FunSpec with Matchers {
class RouteFragmentTests extends AnyFunSpec {
it("Define route with fragment") {
val route = Root $ Fragment[String]
assert(route.route == Root)
Expand Down
5 changes: 3 additions & 2 deletions shared/src/test/scala/trail/RouteParamTests.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package trail

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

class RouteParamTests extends FunSpec with Matchers {
class RouteParamTests extends AnyFunSpec with Matchers {
import Route._

it("Define route with one parameter") {
Expand Down
5 changes: 3 additions & 2 deletions shared/src/test/scala/trail/RouteParseTests.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package trail

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

import scala.util.Try

class RouteParseTests extends FunSpec with Matchers {
class RouteParseTests extends AnyFunSpec with Matchers {
it("Parse root") {
val root = Root
assert(root.parseArgs("/").contains(()))
Expand Down
4 changes: 2 additions & 2 deletions shared/src/test/scala/trail/RoutingTableTests.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package trail

import org.scalatest._
import org.scalatest.funspec.AnyFunSpec

class RoutingTableTests extends FunSpec with Matchers {
class RoutingTableTests extends AnyFunSpec {
it("Express a routing table with pattern matching") {
val details = Root / "details" / Arg[Int]
val userInfo = Root / "user" / Arg[String] / Arg[Boolean]
Expand Down
8 changes: 5 additions & 3 deletions shared/src/test/scala/trail/UrlTests.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package trail

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

class UrlTests extends WordSpec with Matchers {
class UrlTests extends AnyWordSpec with Matchers {
"A Route" when {
"empty" should {
"create root" in {
Expand Down Expand Up @@ -108,7 +110,7 @@ class UrlTests extends WordSpec with Matchers {
}
}

class UrlTests2 extends FunSpec with Matchers {
class UrlTests2 extends AnyFunSpec {
it("url() work with mandatory arguments") {
val userInfo = Root / "user" / Arg[String] / Arg[Boolean]

Expand Down

0 comments on commit 17758bd

Please sign in to comment.