import scala .{PartialFunction => =/> }
val mapper : String = / > String = {
case Header (s) => s
}
val totalMapper = mapper orElse (identity[String ] _): String = / > String
val totalMapper2 = mapper orElse PartialFunction .fromFunction(identity[String ] _)
val Header = """ >> (.*)""" .r
sectioned.map(_.collect((Header .findFirstIn _).unlift))
sectioned.map(_.collect(Function .unlift(Header .findFirstMatchIn)))
CompanionObject .unapply(...).get
Shapeless
libraryDependencies ++ = specs2(" 4.10.0" , Seq (" core" , " html" , " scalacheck" ))
def specs2 (version : String , features : Seq [String ]) =
features.map(fe => " org.specs2" %% f " specs2- $fe%s " % version % " test" )
scalacOptions in Test + = " -Yrangepos" // specs2
testOptions in Test + = Tests .Argument (" console" )
testOptions in Test + = Tests .Argument (" html" )
Docs
import org .specs2 ._
class QuickStartSpec extends Specification { def is = s2 """
This is my first specification
it is working $ok
really working! $ok
"""
}
Docs
Specs2 Linking other specs
$ {" A user may " ~ (" press the button " , new ButtonSpec , " to turn on the blender." )}
Docs