Trait

org.specs2.specification

Groups

Related Doc: package specification

Permalink

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
Linear Supertypes
GroupsLike, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Groups
  2. GroupsLike
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait AutoNumberedGroup extends ExamplesGroup

    Permalink
    Definition Classes
    GroupsLike
  2. class NamedGroup extends AnyRef

    Permalink
  3. trait g1 extends ExamplesGroup

    Permalink
  4. trait g10 extends ExamplesGroup

    Permalink
  5. trait g11 extends ExamplesGroup

    Permalink
  6. trait g12 extends ExamplesGroup

    Permalink
  7. trait g13 extends ExamplesGroup

    Permalink
  8. trait g14 extends ExamplesGroup

    Permalink
  9. trait g15 extends ExamplesGroup

    Permalink
  10. trait g16 extends ExamplesGroup

    Permalink
  11. trait g17 extends ExamplesGroup

    Permalink
  12. trait g18 extends ExamplesGroup

    Permalink
  13. trait g19 extends ExamplesGroup

    Permalink
  14. trait g2 extends ExamplesGroup

    Permalink
  15. trait g20 extends ExamplesGroup

    Permalink
  16. trait g21 extends ExamplesGroup

    Permalink
  17. trait g22 extends ExamplesGroup

    Permalink
  18. trait g3 extends ExamplesGroup

    Permalink
  19. trait g4 extends ExamplesGroup

    Permalink
  20. trait g5 extends ExamplesGroup

    Permalink
  21. trait g6 extends ExamplesGroup

    Permalink
  22. trait g7 extends ExamplesGroup

    Permalink
  23. trait g8 extends ExamplesGroup

    Permalink
  24. trait g9 extends ExamplesGroup

    Permalink
  25. trait group extends ExamplesGroup with (GroupsLike.this)#AutoNumberedGroup

    Permalink
    Definition Classes
    GroupsLike

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def createExamplesGroup(i: Int): ExamplesGroup

    Permalink
    Definition Classes
    GroupsGroupsLike
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. implicit def executionVarIsInterpolatedFragment(executionVar: ⇒ ExecutionVar): InterpolatedFragment

    Permalink
    Definition Classes
    GroupsLike
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. var g1: () ⇒ ExamplesGroup

    Permalink
  12. var g10: () ⇒ ExamplesGroup

    Permalink
  13. var g11: () ⇒ ExamplesGroup

    Permalink
  14. var g12: () ⇒ ExamplesGroup

    Permalink
  15. var g13: () ⇒ ExamplesGroup

    Permalink
  16. var g14: () ⇒ ExamplesGroup

    Permalink
  17. var g15: () ⇒ ExamplesGroup

    Permalink
  18. var g16: () ⇒ ExamplesGroup

    Permalink
  19. var g17: () ⇒ ExamplesGroup

    Permalink
  20. var g18: () ⇒ ExamplesGroup

    Permalink
  21. var g19: () ⇒ ExamplesGroup

    Permalink
  22. var g2: () ⇒ ExamplesGroup

    Permalink
  23. var g20: () ⇒ ExamplesGroup

    Permalink
  24. var g21: () ⇒ ExamplesGroup

    Permalink
  25. var g22: () ⇒ ExamplesGroup

    Permalink
  26. var g3: () ⇒ ExamplesGroup

    Permalink
  27. var g4: () ⇒ ExamplesGroup

    Permalink
  28. var g5: () ⇒ ExamplesGroup

    Permalink
  29. var g6: () ⇒ ExamplesGroup

    Permalink
  30. var g7: () ⇒ ExamplesGroup

    Permalink
  31. var g8: () ⇒ ExamplesGroup

    Permalink
  32. var g9: () ⇒ ExamplesGroup

    Permalink
  33. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  34. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  35. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  36. implicit def namedGroup(s: String): (Groups.this)#NamedGroup

    Permalink
  37. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  38. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  42. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from GroupsLike

Inherited from AnyRef

Inherited from Any

Ungrouped