diff --git a/src/reference/00-Getting-Started/02-sbt-by-example.md b/src/reference/00-Getting-Started/02-sbt-by-example.md index a6ef968f..ff7d632a 100644 --- a/src/reference/00-Getting-Started/02-sbt-by-example.md +++ b/src/reference/00-Getting-Started/02-sbt-by-example.md @@ -200,11 +200,11 @@ sbt:Hello> Note that the prompt has now changed to `sbt:Hello>`. -### Add ScalaTest to libraryDependencies +### Add toolkit-test to libraryDependencies Using an editor, change `build.sbt` as follows: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/build.sbt) {} +@@snip [example-test]($root$/src/sbt-test/ref/example-test/build.sbt) {} Use the `reload` command to reflect the change in `build.sbt`. @@ -226,36 +226,36 @@ sbt:Hello> ~testQuick ### Write a test -Leaving the previous command running, create a file named `src/test/scala/example/HelloSpec.scala` +Leaving the previous command running, create a file named `src/test/scala/example/HelloSuite.scala` using an editor: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/src/test/scala/example/HelloSpec.scala) {} +@@snip [example-test]($root$/src/sbt-test/ref/example-test/src/test/scala/example/HelloSuite.scala) {} `~testQuick` should pick up the change: ``` [info] 2. Monitoring source files for hello/testQuick... [info] Press to interrupt or '?' for more options. -[info] Build triggered by /private/tmp/foo-build/src/test/scala/HelloSpec.scala. Running 'testQuick'. -[info] compiling 1 Scala source to /private/tmp/foo-build/target/scala-2.13/test-classes ... -[info] HelloSpec: -[info] - Hello should start with H *** FAILED *** -[info] "hello" did not start with "H" (HelloSpec.scala:5) -[info] Run completed in 44 milliseconds. -[info] Total number of tests run: 1 -[info] Suites: completed 1, aborted 0 -[info] Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0 -[info] *** 1 TEST FAILED *** +[info] Build triggered by /tmp/foo-build/src/test/scala/example/HelloSuite.scala. Running 'testQuick'. +[info] compiling 1 Scala source to /tmp/foo-build/target/scala-2.13/test-classes ... +HelloSuite: +==> X HelloSuite.Hello should start with H 0.004s munit.FailException: /tmp/foo-build/src/test/scala/example/HelloSuite.scala:4 assertion failed +3: test("Hello should start with H") { +4: assert("hello".startsWith("H")) +5: } + at munit.FunSuite.assert(FunSuite.scala:11) + at HelloSuite.\$anonfun\$new\$1(HelloSuite.scala:4) +[error] Failed: Total 1, Failed 1, Errors 0, Passed 0 [error] Failed tests: -[error] HelloSpec -[error] (Test / testQuick) sbt.TestsFailedException: Tests unsuccessfull +[error] HelloSuite +[error] (Test / testQuick) sbt.TestsFailedException: Tests unsuccessful ``` ### Make the test pass -Using an editor, change `src/test/scala/example/HelloSpec.scala` to: +Using an editor, change `src/test/scala/example/HelloSuite.scala` to: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/changes/HelloSpec.scala) {} +@@snip [example-test]($root$/src/sbt-test/ref/example-test/changes/HelloSuite.scala) {} Confirm that the test passes, then press `Enter` to exit the continuous test. @@ -346,7 +346,7 @@ sbt:Hello> projects sbt:Hello> helloCore/compile ``` -### Add ScalaTest to the subproject +### Add toolkit-test to the subproject Change `build.sbt` as follows: @@ -374,7 +374,7 @@ Use `.dependsOn(...)` to add a dependency on other subprojects. Also let's move ### Parse JSON using uJson -Let's add uJson to `helloCore`. +Let's use uJson from the toolkit in `helloCore`. @@snip [example-weather-build]($root$/src/sbt-test/ref/example-weather/build.sbt) {} @@ -387,18 +387,15 @@ import sttp.client4.quick._ import sttp.client4.Response object Weather { - def weather() = { + def temp() = { val response: Response[String] = quickRequest .get( - uri"https://api.open-meteo.com/v1/forecast?latitude=\$newYorkLatitude&longitude=\$newYorkLongitude¤t_weather=true" + uri"https://api.open-meteo.com/v1/forecast?latitude=40.7143&longitude=-74.006¤t_weather=true" ) .send() val json = ujson.read(response.body) json.obj("current_weather")("temperature").num } - - private val newYorkLatitude: Double = 40.7143 - private val newYorkLongitude: Double = -74.006 } ``` @@ -411,7 +408,7 @@ import example.core.Weather object Hello { def main(args: Array[String]): Unit = { - val temp = Weather.weather() + val temp = Weather.temp() println(s"Hello! The current temperature in New York is \$temp C.") } } @@ -449,9 +446,6 @@ sbt:Hello> dist [info] Main Scala API documentation to /tmp/foo-build/core/target/scala-2.13/api... [info] Wrote /tmp/foo-build/core/target/scala-2.13/hello-core_2.13-0.1.0-SNAPSHOT.pom [info] Main Scala API documentation successful. -[warn] [1] The maintainer is empty -[warn] Add this to your build.sbt -[warn] maintainer := "your.name@company.org" [success] All package validations passed [info] Your package is ready in /tmp/foo-build/target/universal/hello-0.1.0-SNAPSHOT.zip ``` @@ -534,7 +528,7 @@ sbt:Hello> inspect tree dist You can also run sbt in batch mode, passing sbt commands directly from the terminal. ``` -\$ sbt clean "testOnly HelloSpec" +\$ sbt clean "testOnly HelloSuite" ``` **Note**: Running in batch mode requires JVM spinup and JIT each time, diff --git a/src/reference/es/00-Getting-Started/02-sbt-by-example.md b/src/reference/es/00-Getting-Started/02-sbt-by-example.md index 524f5eca..99719e02 100644 --- a/src/reference/es/00-Getting-Started/02-sbt-by-example.md +++ b/src/reference/es/00-Getting-Started/02-sbt-by-example.md @@ -206,11 +206,11 @@ sbt:Hello> Fíjate en cómo el prompt ha cambiado a `sbt:Hello>`. -### Añadir ScalaTest a `libraryDependencies` +### Añadir toolkit-test a `libraryDependencies` Utilizando un editor, modifica `build.sbt` de la siguiente manera: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/build.sbt) {} +@@snip [scalatest]($root$/src/sbt-test/ref/example-test/build.sbt) {} Usa el comando `reload` para reflejar los cambios de `build.sbt`. @@ -233,35 +233,35 @@ sbt:Hello> ~testQuick ### Escribir un test Con el comando anterior ejecutándose, crea un fichero llamado -`src/test/scala/example/HelloSpec.scala` utilizando un editor: +`src/test/scala/example/HelloSuite.scala` utilizando un editor: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/src/test/scala/example/HelloSpec.scala) {} +@@snip [example-test]($root$/src/sbt-test/ref/example-test/src/test/scala/example/HelloSuite.scala) {} `~testQuick` debería de coger el cambio: ``` [info] 2. Monitoring source files for hello/testQuick... [info] Press to interrupt or '?' for more options. -[info] Build triggered by /private/tmp/foo-build/src/test/scala/HelloSpec.scala. Running 'testQuick'. -[info] compiling 1 Scala source to /private/tmp/foo-build/target/scala-2.13/test-classes ... -[info] HelloSpec: -[info] - Hello should start with H *** FAILED *** -[info] "hello" did not start with "H" (HelloSpec.scala:5) -[info] Run completed in 44 milliseconds. -[info] Total number of tests run: 1 -[info] Suites: completed 1, aborted 0 -[info] Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0 -[info] *** 1 TEST FAILED *** +[info] Build triggered by /tmp/foo-build/src/test/scala/example/HelloSuite.scala. Running 'testQuick'. +[info] compiling 1 Scala source to /tmp/foo-build/target/scala-2.13/test-classes ... +HelloSuite: +==> X HelloSuite.Hello should start with H 0.004s munit.FailException: /tmp/foo-build/src/test/scala/example/HelloSuite.scala:4 assertion failed +3: test("Hello should start with H") { +4: assert("hello".startsWith("H")) +5: } +at munit.FunSuite.assert(FunSuite.scala:11) +at HelloSuite.\$anonfun\$new\$1(HelloSuite.scala:4) +[error] Failed: Total 1, Failed 1, Errors 0, Passed 0 [error] Failed tests: -[error] HelloSpec -[error] (Test / testQuick) sbt.TestsFailedException: Tests unsuccessfull +[error] HelloSuite +[error] (Test / testQuick) sbt.TestsFailedException: Tests unsuccessful ``` ### Hacer que el test pase -Utilizando un editor, cambia `src/test/scala/example/HelloSpec.scala` a: +Utilizando un editor, cambia `src/test/scala/example/HelloSuite.scala` a: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/changes/HelloSpec.scala) {} +@@snip [scalatest]($root$/src/sbt-test/ref/example-test/changes/HelloSuite.scala) {} Confirma que el test pasa, luego pulsa `Intro` para salir del test continuo. @@ -353,7 +353,7 @@ sbt:Hello> projects sbt:Hello> helloCore/compile ``` -### Añadir ScalaTest al subproyecto +### Añadir toolkit-test al subproyecto Cambia `build.sbt` como sigue: @@ -382,7 +382,7 @@ Además, movamos la dependencia de Gigahorse a `helloCore`. ### Parsear JSON con uJson -Vamos a añadir uJson a `helloCore`. +Vamos a añadir uJson de toolkit a `helloCore`. @@snip [example-weather-build]($root$/src/sbt-test/ref/example-weather/build.sbt) {} @@ -395,18 +395,15 @@ import sttp.client4.quick._ import sttp.client4.Response object Weather { - def weather() = { + def temp() = { val response: Response[String] = quickRequest .get( - uri"https://api.open-meteo.com/v1/forecast?latitude=\$newYorkLatitude&longitude=\$newYorkLongitude¤t_weather=true" + uri"https://api.open-meteo.com/v1/forecast?latitude=40.7143&longitude=-74.006¤t_weather=true" ) .send() val json = ujson.read(response.body) json.obj("current_weather")("temperature").num } - - private val newYorkLatitude: Double = 40.7143 - private val newYorkLongitude: Double = -74.006 } ``` @@ -420,7 +417,7 @@ import example.core.Weather object Hello { def main(args: Array[String]): Unit = { - val temp = Weather.weather() + val temp = Weather.temp() println(s"Hello! The current temperature in New York is \$temp C.") } } @@ -459,9 +456,6 @@ sbt:Hello> dist [info] Main Scala API documentation to /tmp/foo-build/core/target/scala-2.13/api... [info] Wrote /tmp/foo-build/core/target/scala-2.13/hello-core_2.13-0.1.0-SNAPSHOT.pom [info] Main Scala API documentation successful. -[warn] [1] The maintainer is empty -[warn] Add this to your build.sbt -[warn] maintainer := "your.name@company.org" [success] All package validations passed [info] Your package is ready in /tmp/foo-build/target/universal/hello-0.1.0-SNAPSHOT.zip ``` @@ -489,7 +483,7 @@ Así es cómo puedes ejecutar la app Dockerizada: ``` \$ docker run hello:0.1.0-SNAPSHOT Hello! The current temperature in New York is 22.7 C. -`` +``` ### Establecer la versión @@ -542,7 +536,7 @@ También puedes ejecutar sbt en por lotes, pasando comandos de sbt directamente desde el terminal. ``` -\$ sbt clean "testOnly HelloSpec" +\$ sbt clean "testOnly HelloSuite" ``` **Note**: El modo por lotes implica levantar una JVM y JIT cada vez, por lo que diff --git a/src/reference/ja/00-Getting-Started/02-sbt-by-example.md b/src/reference/ja/00-Getting-Started/02-sbt-by-example.md index 1b202223..68af6d6a 100644 --- a/src/reference/ja/00-Getting-Started/02-sbt-by-example.md +++ b/src/reference/ja/00-Getting-Started/02-sbt-by-example.md @@ -195,11 +195,11 @@ sbt:Hello> プロンプトが `sbt:Hello>` に変わったことに注目してほしい。 -### libraryDependencies に ScalaTest を追加する +### libraryDependencies に toolkit-test を追加する エディタを使って、`build.sbt` を以下のように変更する: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/build.sbt) {} +@@snip [example-test]($root$/src/sbt-test/ref/example-test/build.sbt) {} `reload` コマンドを使って、`build.sbt` の変更を反映させる。 @@ -221,35 +221,35 @@ sbt:Hello> ~testQuick ### テストを書く -上のコマンドを走らせたままで、エディタから `src/test/scala/example/HelloSpec.scala` という名前のファイルを作成する: +上のコマンドを走らせたままで、エディタから `src/test/scala/example/HelloSuite.scala` という名前のファイルを作成する: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/src/test/scala/example/HelloSpec.scala) {} +@@snip [example-test]($root$/src/sbt-test/ref/example-test/src/test/scala/example/HelloSuite.scala) {} `~testQuick` が検知したはずだ: ``` [info] 2. Monitoring source files for hello/testQuick... [info] Press to interrupt or '?' for more options. -[info] Build triggered by /private/tmp/foo-build/src/test/scala/HelloSpec.scala. Running 'testQuick'. -[info] compiling 1 Scala source to /private/tmp/foo-build/target/scala-2.13/test-classes ... -[info] HelloSpec: -[info] - Hello should start with H *** FAILED *** -[info] "hello" did not start with "H" (HelloSpec.scala:5) -[info] Run completed in 44 milliseconds. -[info] Total number of tests run: 1 -[info] Suites: completed 1, aborted 0 -[info] Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0 -[info] *** 1 TEST FAILED *** +[info] Build triggered by /tmp/foo-build/src/test/scala/example/HelloSuite.scala. Running 'testQuick'. +[info] compiling 1 Scala source to /tmp/foo-build/target/scala-2.13/test-classes ... +HelloSuite: +==> X HelloSuite.Hello should start with H 0.004s munit.FailException: /tmp/foo-build/src/test/scala/example/HelloSuite.scala:4 assertion failed +3: test("Hello should start with H") { +4: assert("hello".startsWith("H")) +5: } +at munit.FunSuite.assert(FunSuite.scala:11) +at HelloSuite.\$anonfun\$new\$1(HelloSuite.scala:4) +[error] Failed: Total 1, Failed 1, Errors 0, Passed 0 [error] Failed tests: -[error] HelloSpec -[error] (Test / testQuick) sbt.TestsFailedException: Tests unsuccessfull +[error] HelloSuite +[error] (Test / testQuick) sbt.TestsFailedException: Tests unsuccessful ``` ### テストが通るようにする -エディタを使って `src/test/scala/example/HelloSpec.scala` を以下のように変更する: +エディタを使って `src/test/scala/example/HelloSuite.scala` を以下のように変更する: -@@snip [scalatest]($root$/src/sbt-test/ref/example-scalatest/changes/HelloSpec.scala) {} +@@snip [example-test]($root$/src/sbt-test/ref/example-test/changes/HelloSuite.scala) {} テストが通過したことを確認して、`Enter` を押して継続的テストを抜ける。 @@ -338,7 +338,7 @@ sbt:Hello> projects sbt:Hello> helloCore/compile ``` -### サブプロジェクトに ScalaTest を追加する +### サブプロジェクトに toolkit-test を追加する `build.sbt` を以下のように変更する: @@ -380,18 +380,15 @@ import sttp.client4.quick._ import sttp.client4.Response object Weather { - def weather() = { + def temp() = { val response: Response[String] = quickRequest .get( - uri"https://api.open-meteo.com/v1/forecast?latitude=\$newYorkLatitude&longitude=\$newYorkLongitude¤t_weather=true" + uri"https://api.open-meteo.com/v1/forecast?latitude=40.7143&longitude=-74.006¤t_weather=true" ) .send() val json = ujson.read(response.body) json.obj("current_weather")("temperature").num } - - private val newYorkLatitude: Double = 40.7143 - private val newYorkLongitude: Double = -74.006 } ``` @@ -404,7 +401,7 @@ import example.core.Weather object Hello { def main(args: Array[String]): Unit = { - val temp = Weather.weather() + val temp = Weather.temp() println(s"Hello! The current temperature in New York is \$temp C.") } } @@ -443,9 +440,6 @@ sbt:Hello> dist [info] Main Scala API documentation to /tmp/foo-build/core/target/scala-2.13/api... [info] Wrote /tmp/foo-build/core/target/scala-2.13/hello-core_2.13-0.1.0-SNAPSHOT.pom [info] Main Scala API documentation successful. -[warn] [1] The maintainer is empty -[warn] Add this to your build.sbt -[warn] maintainer := "your.name@company.org" [success] All package validations passed [info] Your package is ready in /tmp/foo-build/target/universal/hello-0.1.0-SNAPSHOT.zip ``` @@ -526,7 +520,7 @@ sbt:Hello> inspect tree dist sbt のコマンドをターミナルから直接渡して sbt をバッチモードで実行することができる。 ``` -\$ sbt clean "testOnly HelloSpec" +\$ sbt clean "testOnly HelloSuite" ``` **Note**: バッチモードでの実行は JVM のスピンアップと JIT を毎回行うため、**ビルドかなり遅くなる。** diff --git a/src/sbt-test/ref/example-library/build.sbt b/src/sbt-test/ref/example-library/build.sbt index a9d620f4..a0691af7 100644 --- a/src/sbt-test/ref/example-library/build.sbt +++ b/src/sbt-test/ref/example-library/build.sbt @@ -6,8 +6,7 @@ lazy val hello = project .settings( name := "Hello", libraryDependencies ++= Seq( - "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M2", - "com.lihaoyi" %% "ujson" % "3.1.2", - "org.scalatest" %% "scalatest" % "3.2.16" % Test + "org.scala-lang" %% "toolkit" % "0.1.7", + "org.scala-lang" %% "toolkit-test" % "0.1.7" % Test ) ) diff --git a/src/sbt-test/ref/example-scalatest/changes/HelloSpec.scala b/src/sbt-test/ref/example-scalatest/changes/HelloSpec.scala deleted file mode 100644 index 939eb83e..00000000 --- a/src/sbt-test/ref/example-scalatest/changes/HelloSpec.scala +++ /dev/null @@ -1,8 +0,0 @@ -import org.scalatest.funsuite._ - -class HelloSpec extends AnyFunSuite { - test("Hello should start with H") { - // Hello, as opposed to hello - assert("Hello".startsWith("H")) - } -} diff --git a/src/sbt-test/ref/example-scalatest/test b/src/sbt-test/ref/example-scalatest/test deleted file mode 100644 index 9c6e6213..00000000 --- a/src/sbt-test/ref/example-scalatest/test +++ /dev/null @@ -1,4 +0,0 @@ -> compile --> testQuick -$copy-file changes/HelloSpec.scala src/test/scala/example/HelloSpec.scala -> testQuick diff --git a/src/sbt-test/ref/example-sub1/build.sbt b/src/sbt-test/ref/example-sub1/build.sbt index 14ae0893..a771a816 100644 --- a/src/sbt-test/ref/example-sub1/build.sbt +++ b/src/sbt-test/ref/example-sub1/build.sbt @@ -6,9 +6,8 @@ lazy val hello = project .settings( name := "Hello", libraryDependencies ++= Seq( - "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M2", - "com.lihaoyi" %% "ujson" % "3.1.2", - "org.scalatest" %% "scalatest" % "3.2.16" % Test + "org.scala-lang" %% "toolkit" % "0.1.7", + "org.scala-lang" %% "toolkit-test" % "0.1.7" % Test ) ) diff --git a/src/sbt-test/ref/example-sub2/build.sbt b/src/sbt-test/ref/example-sub2/build.sbt index f079d196..7d82aa49 100644 --- a/src/sbt-test/ref/example-sub2/build.sbt +++ b/src/sbt-test/ref/example-sub2/build.sbt @@ -1,16 +1,15 @@ ThisBuild / scalaVersion := "2.13.11" ThisBuild / organization := "com.example" -val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" +val toolkitTest = "org.scala-lang" %% "toolkit-test" % "0.1.7" lazy val hello = project .in(file(".")) .settings( name := "Hello", libraryDependencies ++= Seq( - "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M2", - "com.lihaoyi" %% "ujson" % "3.1.2", - scalaTest % Test + "org.scala-lang" %% "toolkit" % "0.1.7", + toolkitTest % Test ) ) @@ -18,5 +17,5 @@ lazy val helloCore = project .in(file("core")) .settings( name := "Hello Core", - libraryDependencies += scalaTest % Test + libraryDependencies += toolkitTest % Test ) diff --git a/src/sbt-test/ref/example-sub3/build.sbt b/src/sbt-test/ref/example-sub3/build.sbt index 8291d930..e3a39333 100644 --- a/src/sbt-test/ref/example-sub3/build.sbt +++ b/src/sbt-test/ref/example-sub3/build.sbt @@ -1,7 +1,7 @@ ThisBuild / scalaVersion := "2.13.11" ThisBuild / organization := "com.example" -val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" +val toolkitTest = "org.scala-lang" %% "toolkit-test" % "0.1.7" lazy val hello = project .in(file(".")) @@ -9,9 +9,8 @@ lazy val hello = project .settings( name := "Hello", libraryDependencies ++= Seq( - "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M2", - "com.lihaoyi" %% "ujson" % "3.1.2", - scalaTest % Test + "org.scala-lang" %% "toolkit" % "0.1.7", + toolkitTest % Test ) ) @@ -19,5 +18,5 @@ lazy val helloCore = project .in(file("core")) .settings( name := "Hello Core", - libraryDependencies += scalaTest % Test + libraryDependencies += toolkitTest % Test ) diff --git a/src/sbt-test/ref/example-sub4/build.sbt b/src/sbt-test/ref/example-sub4/build.sbt index 84a15ae0..2150caa7 100644 --- a/src/sbt-test/ref/example-sub4/build.sbt +++ b/src/sbt-test/ref/example-sub4/build.sbt @@ -1,7 +1,7 @@ ThisBuild / scalaVersion := "2.13.11" ThisBuild / organization := "com.example" -val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" +val toolkitTest = "org.scala-lang" %% "toolkit-test" % "0.1.7" lazy val hello = project .in(file(".")) @@ -9,16 +9,13 @@ lazy val hello = project .dependsOn(helloCore) .settings( name := "Hello", - libraryDependencies ++= Seq( - "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M2", - "com.lihaoyi" %% "ujson" % "3.1.2", - scalaTest % Test - ) + libraryDependencies += toolkitTest % Test ) lazy val helloCore = project .in(file("core")) .settings( name := "Hello Core", - libraryDependencies += scalaTest % Test + libraryDependencies += "org.scala-lang" %% "toolkit" % "0.1.7", + libraryDependencies += toolkitTest % Test ) diff --git a/src/sbt-test/ref/example-scalatest/build.sbt b/src/sbt-test/ref/example-test/build.sbt similarity index 67% rename from src/sbt-test/ref/example-scalatest/build.sbt rename to src/sbt-test/ref/example-test/build.sbt index b0e80bf1..07208f11 100644 --- a/src/sbt-test/ref/example-scalatest/build.sbt +++ b/src/sbt-test/ref/example-test/build.sbt @@ -5,5 +5,5 @@ lazy val hello = project .in(file(".")) .settings( name := "Hello", - libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.16" % Test + libraryDependencies += "org.scala-lang" %% "toolkit-test" % "0.1.7" % Test ) diff --git a/src/sbt-test/ref/example-test/changes/HelloSuite.scala b/src/sbt-test/ref/example-test/changes/HelloSuite.scala new file mode 100644 index 00000000..e9ab5344 --- /dev/null +++ b/src/sbt-test/ref/example-test/changes/HelloSuite.scala @@ -0,0 +1,6 @@ + +class HelloSuite extends munit.FunSuite { + test("Hello should start with H") { + assert("Hello".startsWith("H")) + } +} diff --git a/src/sbt-test/ref/example-scalatest/src/test/scala/example/HelloSpec.scala b/src/sbt-test/ref/example-test/src/test/scala/example/HelloSuite.scala similarity index 53% rename from src/sbt-test/ref/example-scalatest/src/test/scala/example/HelloSpec.scala rename to src/sbt-test/ref/example-test/src/test/scala/example/HelloSuite.scala index 1553617a..0f05e9bc 100644 --- a/src/sbt-test/ref/example-scalatest/src/test/scala/example/HelloSpec.scala +++ b/src/sbt-test/ref/example-test/src/test/scala/example/HelloSuite.scala @@ -1,6 +1,5 @@ -import org.scalatest.funsuite._ -class HelloSpec extends AnyFunSuite { +class HelloSuite extends munit.FunSuite { test("Hello should start with H") { assert("hello".startsWith("H")) } diff --git a/src/sbt-test/ref/example-test/test b/src/sbt-test/ref/example-test/test new file mode 100644 index 00000000..c76c270b --- /dev/null +++ b/src/sbt-test/ref/example-test/test @@ -0,0 +1,4 @@ +> compile +-> testQuick +$copy-file changes/HelloSuite.scala src/test/scala/example/HelloSuite.scala +> testQuick diff --git a/src/sbt-test/ref/example-weather/build.sbt b/src/sbt-test/ref/example-weather/build.sbt index 4b32b726..2150caa7 100644 --- a/src/sbt-test/ref/example-weather/build.sbt +++ b/src/sbt-test/ref/example-weather/build.sbt @@ -1,9 +1,7 @@ ThisBuild / scalaVersion := "2.13.11" ThisBuild / organization := "com.example" -val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" -val sttp = "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M2" -val ujson = "com.lihaoyi" %% "ujson" % "3.1.2" +val toolkitTest = "org.scala-lang" %% "toolkit-test" % "0.1.7" lazy val hello = project .in(file(".")) @@ -11,16 +9,13 @@ lazy val hello = project .dependsOn(helloCore) .settings( name := "Hello", - libraryDependencies += scalaTest % Test + libraryDependencies += toolkitTest % Test ) lazy val helloCore = project .in(file("core")) .settings( name := "Hello Core", - libraryDependencies ++= Seq( - scalaTest % Test, - sttp, - ujson - ) + libraryDependencies += "org.scala-lang" %% "toolkit" % "0.1.7", + libraryDependencies += toolkitTest % Test ) diff --git a/src/sbt-test/ref/example-weather/changes/build.sbt b/src/sbt-test/ref/example-weather/changes/build.sbt index c3da652c..3083521a 100644 --- a/src/sbt-test/ref/example-weather/changes/build.sbt +++ b/src/sbt-test/ref/example-weather/changes/build.sbt @@ -1,9 +1,7 @@ ThisBuild / scalaVersion := "2.13.11" ThisBuild / organization := "com.example" -val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" -val sttp = "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M2" -val ujson = "com.lihaoyi" %% "ujson" % "3.1.2" +val toolkitTest = "org.scala-lang" %% "toolkit-test" % "0.1.7" lazy val hello = project .in(file(".")) @@ -12,16 +10,14 @@ lazy val hello = project .enablePlugins(JavaAppPackaging) .settings( name := "Hello", - libraryDependencies += scalaTest % Test + libraryDependencies += toolkitTest % Test, + maintainer := "A Scala Dev!" ) lazy val helloCore = project .in(file("core")) .settings( name := "Hello Core", - libraryDependencies ++= Seq( - scalaTest % Test, - sttp, - ujson - ) + libraryDependencies += "org.scala-lang" %% "toolkit" % "0.1.7", + libraryDependencies += toolkitTest % Test ) diff --git a/src/sbt-test/ref/example-weather/changes/build3.sbt b/src/sbt-test/ref/example-weather/changes/build3.sbt index b6bc0d9e..fe47531c 100644 --- a/src/sbt-test/ref/example-weather/changes/build3.sbt +++ b/src/sbt-test/ref/example-weather/changes/build3.sbt @@ -2,9 +2,7 @@ ThisBuild / version := "0.1.0" ThisBuild / scalaVersion := "2.13.11" ThisBuild / organization := "com.example" -val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" -val sttp = "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M2" -val ujson = "com.lihaoyi" %% "ujson" % "3.1.2" +val toolkitTest = "org.scala-lang" %% "toolkit-test" % "0.1.7" lazy val hello = project .in(file(".")) @@ -13,16 +11,14 @@ lazy val hello = project .enablePlugins(JavaAppPackaging) .settings( name := "Hello", - libraryDependencies += scalaTest % Test + libraryDependencies += toolkitTest % Test, + maintainer := "A Scala Dev!" ) lazy val helloCore = project .in(file("core")) .settings( name := "Hello Core", - libraryDependencies ++= Seq( - scalaTest % Test, - sttp, - ujson - ) + libraryDependencies += "org.scala-lang" %% "toolkit" % "0.1.7", + libraryDependencies += toolkitTest % Test )