Skip to content

Commit 9ac6061

Browse files
committed
Update scalatest to 3.2.11 in IntelliJ example
1 parent 86724d3 commit 9ac6061

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

_getting-started/intellij-track/testing-scala-in-intellij-with-scalatest.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ This assumes you know [how to build a project in IntelliJ](building-a-scala-proj
2020
1. Add the ScalaTest dependency:
2121
1. Add the ScalaTest dependency to your `build.sbt` file:
2222
```
23-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % Test
23+
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.11" % Test
2424
```
2525
1. If you get a notification "build.sbt was changed", select **auto-import**.
2626
1. These two actions will cause `sbt` to download the ScalaTest library.
27-
1. Wait for the `sbt` sync to finish; otherwise, `FunSuite` and `test()` will be
27+
1. Wait for the `sbt` sync to finish; otherwise, `AnyFunSuite` and `test()` will be
2828
unrecognized.
2929
1. On the project pane on the left, expand `src` => `main`.
3030
1. Right-click on `scala` and select **New** => **Scala class**.
31-
1. Call it `CubeCalculator`, change the **Kind** to `object`, and click **OK**.
31+
1. Call it `CubeCalculator`, change the **Kind** to `object`, and hit enter or double click on `object`.
3232
1. Replace the code with the following:
3333
```
3434
object CubeCalculator extends App {
@@ -41,12 +41,12 @@ This assumes you know [how to build a project in IntelliJ](building-a-scala-proj
4141
## Creating a test
4242
1. On the project pane on the left, expand `src` => `test`.
4343
1. Right-click on `scala` and select **New** => **Scala class**.
44-
1. Name the class `CubeCalculatorTest` and click **OK**.
44+
1. Name the class `CubeCalculatorTest` and hit enter or double click on `class`.
4545
1. Replace the code with the following:
4646
```
47-
import org.scalatest.FunSuite
47+
import org.scalatest.funsuite.AnyFunSuite
4848
49-
class CubeCalculatorTest extends FunSuite {
49+
class CubeCalculatorTest extends AnyFunSuite {
5050
test("CubeCalculator.cube") {
5151
assert(CubeCalculator.cube(3) === 27)
5252
}
@@ -60,9 +60,9 @@ This assumes you know [how to build a project in IntelliJ](building-a-scala-proj
6060
Let's go over this line by line:
6161
6262
* `class CubeCalculatorTest` means we are testing the object `CubeCalculator`
63-
* `extends FunSuite` lets us use functionality of ScalaTest's FunSuite class
63+
* `extends AnyFunSuite` lets us use functionality of ScalaTest's AnyFunSuite class
6464
such as the `test` function
65-
* `test` is function that comes from the FunSuite library that collects
65+
* `test` is a function that comes from the FunSuite library that collects
6666
results from assertions within the function body.
6767
* `"CubeCalculator.cube"` is a name for the test. You can call it anything but
6868
one convention is "ClassName.methodName".

0 commit comments

Comments
 (0)