org.scalatest.matchers.DeprecatedShouldMatchers
This class is part of the ScalaTest matchers DSL. Please see the documentation for DeprecatedShouldMatchers
or DeprecatedMustMatchers
for an overview of
the matchers DSL.
This class is used in conjunction with an implicit conversion to enable should
methods to
be invoked on String
s.
This method enables syntax such as the following:
This method enables syntax such as the following:
string should not have length (3)
This method enables syntax such as the following:
This method enables syntax such as the following:
string should fullyMatch regex ("""(-)?(\d+)(\.\d*)?""")
This method enables syntax such as the following:
This method enables syntax such as the following:
string should endWith regex ("world")
This method enables syntax such as the following:
This method enables syntax such as the following:
string should startWith regex ("hello")
This method enables syntax such as the following:
This method enables syntax such as the following:
string should include regex ("hi")
This method enables syntax such as the following:
This method enables syntax such as the following:
string should have length (3)
This method enables syntax such as the following:
This method enables syntax such as the following:
string should be theSameInstanceAs anotherObject
This method enables syntax such as the following:
This method enables syntax such as the following:
string should equal ("hi")
Supports the registration of subject descriptions with after words
in WordSpec
and FixtureWordSpec
.
Supports the registration of subject descriptions with after words
in WordSpec
and FixtureWordSpec
.
For example, this method enables syntax such as the following in WordSpec
and FixtureWordSpec
:
def provide = afterWord("provide")"The ScalaTest Matchers DSL" should provide {
WordSpec
passes in a function via the implicit parameter that takes
two strings and a ResultOfAfterWordApplication
and results in Unit
. This method
simply invokes this function, passing in left, the verb string
"should"
, and the ResultOfAfterWordApplication
passed to should
.
Supports the registration of subject descriptions in WordSpec
and FixtureWordSpec
.
Supports the registration of subject descriptions in WordSpec
and FixtureWordSpec
.
For example, this method enables syntax such as the following in WordSpec
and FixtureWordSpec
:
"A Stack (when empty)" should { ...
WordSpec
passes in a function via the implicit parameter of type StringVerbBlockRegistration
,
a function that takes two strings and a no-arg function and results in Unit
. This method
simply invokes this function, passing in left, the verb string
"should"
, and the right by-name parameter transformed into a
no-arg function.
Supports shared test registration in FlatSpec
and FixtureFlatSpec
.
Supports shared test registration in FlatSpec
and FixtureFlatSpec
.
For example, this method enables syntax such as the following in FlatSpec
and FixtureFlatSpec
:
"A Stack (with one item)" should behave like nonEmptyStack(stackWithOneItem, lastValuePushed)
FlatSpec
and FixtureFlatSpec
passes in a function via the implicit parameter that takes
a string and results in a BehaveWord
. This method
simply invokes this function, passing in left, and returns the result.
Supports test registration in FlatSpec
and FixtureFlatSpec
.
Supports test registration in FlatSpec
and FixtureFlatSpec
.
For example, this method enables syntax such as the following in FlatSpec
and FixtureFlatSpec
:
"A Stack (when empty)" should "be empty" in { ... }
FlatSpec
passes in a function via the implicit parameter that takes
three strings and results in a ResultOfStringPassedToVerb
. This method
simply invokes this function, passing in left, the verb string
"should"
, and right, and returns the result.
This class is part of the ScalaTest matchers DSL. Please see the documentation for
DeprecatedShouldMatchers
orDeprecatedMustMatchers
for an overview of the matchers DSL.This class is used in conjunction with an implicit conversion to enable
should
methods to be invoked onString
s.