trait Groups extends GroupsLike
This trait can be used to standardize names for groups of examples in an acceptance specification.
class MySpecification extends Specification with Examples { def is = s2""" first example in first group ${g1().e1} second example in first group ${g1().e2}
first example in second group ${g2().e1} second example in second group ${g2().e2} """ }
trait Examples extends Groups with Matchers { "first group of examples" - new g1 { e1 := ok e2 := ok } "second group of examples" - new g2 { e1 := ok e2 := ok } }
It is important to notice that the examples must be called with g1().e1
so as to create a new g1
trait instance
with new local variables for the example e1
. If this is not required, the Grouped
trait can be used instead
If you don't want to manage groups and examples numbers it is also possible to write the following (note the script.Specification
):
class MySpecification extends script.Specification with Examples { def is = s2""" first example in first group second example in first group
first example in second group second example in second group """ }
trait Examples extends Groups with Matchers { "first group of examples" - new group { eg := ok eg := ok } "second group of examples" - new group { eg := ok eg := ok } }
- Self Type
- Groups with S2StringContextCreation
- Alphabetic
- By Inheritance
- Groups
- GroupsLike
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- class NamedGroup extends AnyRef
- trait g1 extends ExamplesGroup
- trait g10 extends ExamplesGroup
- trait g11 extends ExamplesGroup
- trait g12 extends ExamplesGroup
- trait g13 extends ExamplesGroup
- trait g14 extends ExamplesGroup
- trait g15 extends ExamplesGroup
- trait g16 extends ExamplesGroup
- trait g17 extends ExamplesGroup
- trait g18 extends ExamplesGroup
- trait g19 extends ExamplesGroup
- trait g2 extends ExamplesGroup
- trait g20 extends ExamplesGroup
- trait g21 extends ExamplesGroup
- trait g22 extends ExamplesGroup
- trait g3 extends ExamplesGroup
- trait g4 extends ExamplesGroup
- trait g5 extends ExamplesGroup
- trait g6 extends ExamplesGroup
- trait g7 extends ExamplesGroup
- trait g8 extends ExamplesGroup
- trait g9 extends ExamplesGroup
- trait AutoNumberedGroup extends ExamplesGroup
- Definition Classes
- GroupsLike
- trait group extends ExamplesGroup with (GroupsLike.this)#AutoNumberedGroup
- Definition Classes
- GroupsLike
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def createExamplesGroup(i: Int): ExamplesGroup
- Definition Classes
- Groups → GroupsLike
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit def executionVarIsInterpolatedFragment(executionVar: => ExecutionVar): InterpolatedFragment
- Definition Classes
- GroupsLike
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val g1: () => ExamplesGroup
- val g10: () => ExamplesGroup
- val g11: () => ExamplesGroup
- val g12: () => ExamplesGroup
- val g13: () => ExamplesGroup
- val g14: () => ExamplesGroup
- val g15: () => ExamplesGroup
- val g16: () => ExamplesGroup
- val g17: () => ExamplesGroup
- val g18: () => ExamplesGroup
- val g19: () => ExamplesGroup
- val g2: () => ExamplesGroup
- val g20: () => ExamplesGroup
- val g21: () => ExamplesGroup
- val g22: () => ExamplesGroup
- val g3: () => ExamplesGroup
- val g4: () => ExamplesGroup
- val g5: () => ExamplesGroup
- val g6: () => ExamplesGroup
- val g7: () => ExamplesGroup
- val g8: () => ExamplesGroup
- val g9: () => ExamplesGroup
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit def namedGroup(s: String): (Groups.this)#NamedGroup
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()