https://github.com/thoughtworksinc/sbt-example
Run Scaladoc as unit tests
https://github.com/thoughtworksinc/sbt-example
sbt sbt-plugin scala scaladoc testing unit-testing
Last synced: 2 months ago
JSON representation
Run Scaladoc as unit tests
- Host: GitHub
- URL: https://github.com/thoughtworksinc/sbt-example
- Owner: ThoughtWorksInc
- License: apache-2.0
- Created: 2017-05-19T06:16:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-30T23:24:51.000Z (3 months ago)
- Last Synced: 2025-03-31T00:18:56.870Z (3 months ago)
- Topics: sbt, sbt-plugin, scala, scaladoc, testing, unit-testing
- Language: Scala
- Homepage:
- Size: 472 KB
- Stars: 32
- Watchers: 20
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sbt-example
[](https://github.com/ThoughtWorksInc/sbt-example/actions/workflows/scala.yml)
[](https://javadoc.io/page/com.thoughtworks.example/sbt-example_2.12_1.0/12/com/thoughtworks/Example$.html)
[](https://index.scala-lang.org/thoughtworksinc/sbt-example)**sbt-example** is an sbt plug-in for creating unit tests from examples in Scaladoc.
The previous version of this project is the macro annotation [`@example`](https://javadoc.io/page/com.thoughtworks.example/unidoc_2.12/2.0.0/com/thoughtworks/example.html), which is [deprecated](https://github.com/scalameta/scalameta/issues/1182) and does not support Scala 2.12.5+ version.
## Showcases
* [AsynchronousPool](https://javadoc.io/page/com.thoughtworks.raii/asynchronous_2.12/latest/com/thoughtworks/raii/AsynchronousPool$.html) - an asynchronous resource pool, whose Scaladoc contains tests written in [ScalaTest](https://scalatest.org/) and [ScalaMock](https://scalamock.org)
* [Factory](https://javadoc.io/page/com.thoughtworks.feature/the_2.12/latest/com/thoughtworks/feature/Factory.html) - a dependent-type type class for dependency injection, whose Scaladoc contains a huge number of small usecases.
* [PartialApply](https://javadoc.io/page/com.thoughtworks.feature/the_2.12/latest/com/thoughtworks/feature/PartialApply.html) - a dependent-type type class for partial applying a function, whose Scaladoc is written in [Given-When-Then](https://martinfowler.com/bliki/GivenWhenThen.html) style.
* [NullSafe](https://javadoc.io/page/com.thoughtworks.dsl/dsl_2.12/latest/com/thoughtworks/dsl/keywords/NullSafe.html) - a library to provide Kotlin / Groovy flavored null-safe `?` operator in Scala.
* [scalajs-all-in-one-template](https://github.com/Atry/scalajs-all-in-one-template/blob/master/js/src/main/scala/views/Main.scala) - a project template for Scala.js static web projects, whose Scaladoc contains examples executed in [jsdom](https://github.com/jsdom/jsdom).(Feel free to add your Scaladoc here)
### Dogfooding
* [Documentation of sbt-example](https://javadoc.io/page/com.thoughtworks.example/sbt-example_2.12_1.0/12/com/thoughtworks/Example$.html) - sbt-example eats its own dog food. The tests of sbt-example are generated by sbt-example itself from Scaladoc, which can be also considered as the documentation for using sbt-example.
## Requirements
* Sbt 1.x