class Example(description: String) { def in[T](expectations: =>T)(implicit def m: scala.reflect.Manifest[T]): Example = { if (m.erasure == this.getClass) hasSubExamples = true
// store expectations for later evaluation } }
/** * This allow me to define in specs examples which know if they have nested examples * without having to be evaluated */
"this example is simple" in { 1 must_== 1 } "this example has a nested example but it doesn't have to be evaluated to know it!" in { "I am nested" in { 1 must_== 1 } }