Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention additional dependencies in lawtesting docs #3072

Merged
merged 1 commit into from
Sep 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/src/main/tut/typeclasses/lawtesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ object arbitraries {
Now we can convert these `ScalaCheck` `Properties` into tests that the test framework can run. [discipline](https://github.com/typelevel/discipline) provides a helper `checkAll` function that performs
this conversion for two test frameworks: `ScalaTest` and `Specs2`.

* If you are using `Specs2`, extend your test class with `org.typelevel.discipline.specs2.Discipline`.
* If you are using `Specs2`, extend your test class with `org.typelevel.discipline.specs2.Discipline` (provided by `discipline-specs2`).

* If you are using `ScalaTest`, extend your test class with `org.typelevel.discipline.scalatest.Discipline` and `org.scalatest.funsuite.AnyFunSuiteLike`.
* If you are using `ScalaTest`, extend your test class with `org.typelevel.discipline.scalatest.Discipline` (provided by `discipline-scalatest`) and `org.scalatest.funsuite.AnyFunSuiteLike`.

* For other test frameworks, you need to resort to their integration with `ScalaCheck` to test
the `ScalaCheck` `Properties` provided by cats-laws.
the `ScalaCheck` `Properties` provided by `cats-laws`.

The following example is for ScalaTest. If not using
The following example is for ScalaTest.

```tut:book
import cats.implicits._
Expand All @@ -109,8 +109,8 @@ class TreeLawTests extends AnyFunSuite with Discipline {
* `Discipline` provides `checkAll`, and must be mixed into `AnyFunSuite`
* `arbitraries._` imports the `Arbitrary[Tree[_]]` instances needed to check the laws.

Alternatively, you can use the `CatsSuite` provided by [Cats-testkit-scalatest](https://github.com/typelevel/cats-testkit-scalatest),
which is the same `CatsSuite` used in Cats to test all instances.
Alternatively, you can use the `CatsSuite` provided by [Cats-testkit-scalatest](https://github.com/typelevel/cats-testkit-scalatest),
which is the same `CatsSuite` used in Cats to test all instances.

Now when we run `test` in our sbt console, ScalaCheck will test if the `Functor` laws hold for our `Tree` type.
You should see something like this:
Expand Down