Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

Run Scaladoc as unit tests

Awesome Lists containing this project

README

        

# sbt-example [](http://thoughtworks.com)

[![Build Status](https://travis-ci.org/ThoughtWorksInc/sbt-example.svg)](https://travis-ci.org/ThoughtWorksInc/sbt-example)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.thoughtworks.example/sbt-example/badge.svg)](https://search.maven.org/search?q=g:com.thoughtworks.example%20AND%20a:sbt-example&core=gav)

**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://oss.sonatype.org/service/local/repositories/public/archive/com/thoughtworks/example/sbt-example_2.12_1.0/9.2.0/sbt-example-9.2.0-javadoc.jar/!/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