|
ScalaTest 1.0
|
|
org/scalatest/verb/BehaveWord.scala]
final
class
BehaveWord
extends AnyRefbehave field of Specs,
FlatSpecs, and WordSpecs 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 Specs, FlatSpecs,
FixtureSpecs, and FixtureFlatSpecs:
it should behave like nonFullStack(stackWithOneItem)
^
It also enables syntax such as the following syntax in WordSpecs and FixtureWordSpecs:
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 Specs, FlatSpecs,
FixtureSpecs, and FixtureFlatSpecs:
it should behave like nonFullStack(stackWithOneItem)
^
It also enables syntax such as the following syntax in WordSpecs and FixtureWordSpecs:
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.0
|
|