trait
Groups extends GroupsLike
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
createExamplesGroup(i: Int): ExamplesGroup
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
implicit
def
executionVarIsInterpolatedFragment(executionVar: ⇒ ExecutionVar): InterpolatedFragment
-
def
finalize(): Unit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
implicit
def
namedGroup(s: String): (Groups.this)#NamedGroup
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
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 newg1
trait instance with new local variables for the examplee1
. If this is not required, theGrouped
trait can be used insteadIf 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 } }