ScalaTest 1.1
|
|
org/scalatest/verb/BehaveWord.scala
]
final
class
BehaveWord
extends
AnyRefbehave
field of Spec
s,
FlatSpec
s, and WordSpec
s as well as instance of their sister traits,
FixtureSpec
, FixtureFlatSpec
, and FixtureWordSpec
.
This class, via the behave
field, enables syntax such as the following in Spec
s, FlatSpec
s,
FixtureSpec
s, and FixtureFlatSpecs
:
it should behave like nonFullStack(stackWithOneItem) ^
It also enables syntax such as the following syntax in WordSpec
s and FixtureWordSpec
s:
behave like nonEmptyStack(lastValuePushed) ^
For more information and examples of the use of Spec
,
FlatSpec
, or WordSpec
.
Method Summary | |
def
|
like
(unit : Unit) : Unit
Supports the registration of shared tests.
|
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
This method enables syntax such as the following in Spec
s, FlatSpec
s,
FixtureSpec
s, and FixtureFlatSpecs
:
it should behave like nonFullStack(stackWithOneItem) ^
It also enables syntax such as the following syntax in WordSpec
s and FixtureWordSpec
s:
behave like nonEmptyStack(lastValuePushed) ^
This method just provides syntax sugar intended to make the intent of the code clearer.
Because the parameter passed to it is
type Unit
, the expression will be evaluated before being passed, which
is sufficient to register the shared tests.
For more information and examples of the use of Spec
,
FlatSpec
, or WordSpec
.
ScalaTest 1.1
|
|