Skip to content

Instantly share code, notes, and snippets.

@maji-KY
Created June 5, 2016 03:03
Show Gist options
  • Save maji-KY/f96bb74a427688249afb2dcd19b867ff to your computer and use it in GitHub Desktop.
Save maji-KY/f96bb74a427688249afb2dcd19b867ff to your computer and use it in GitHub Desktop.
Scalaz ScalaCheckBinding runs on Specs2
import org.scalacheck.Properties
import org.specs2.ScalaCheck
import org.specs2.scalacheck.Parameters
import org.specs2.specification.core.Fragments
import scalaz.Scalaz._
import scalaz.scalacheck.ScalazProperties._
class ResourceSpec extends org.specs2.mutable.Specification with ScalaCheck {
def toExamples(props: Properties, verbosity: Int = 1): Fragments =
t ^ Fragments.foreach(props.properties) { case (name, prop) => br ^ name ! prop.setVerbosity(verbosity) }
"Option" should {
"Option is monad" >> toExamples(monad.laws[Option])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment