This method enables syntax such as the following:
This method enables syntax such as the following:
string must compile ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string must fullyMatch regex ("""(-)?(\d+)(\.\d*)?""") ^
Supports the registration of subject descriptions with after words
in WordSpec
and fixture.WordSpec
.
Supports the registration of subject descriptions with after words
in WordSpec
and fixture.WordSpec
.
For example, this method enables syntax such as the following in WordSpec
and fixture.WordSpec
:
def provide = afterWord("provide") "The ScalaTest Matchers DSL" must 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 leftSideString, the verb string
"must"
, and the ResultOfAfterWordApplication
passed to must
.
Supports the registration of subject descriptions in WordSpec
and fixture.WordSpec
.
Supports the registration of subject descriptions in WordSpec
and fixture.WordSpec
.
For example, this method enables syntax such as the following in WordSpec
and fixture.WordSpec
:
"A Stack (when empty)" must { ... ^
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 leftSideString, the verb string
"must"
, and the right by-name parameter transformed into a
no-arg function.
Supports shared test registration in FlatSpec
and fixture.FlatSpec
.
Supports shared test registration in FlatSpec
and fixture.FlatSpec
.
For example, this method enables syntax such as the following in FlatSpec
and fixture.FlatSpec
:
"A Stack (with one item)" must behave like nonEmptyStack(stackWithOneItem, lastValuePushed) ^
FlatSpec
and fixture.FlatSpec
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 leftSideString, and returns the result.
Supports test registration in FlatSpec
and fixture.FlatSpec
.
Supports test registration in FlatSpec
and fixture.FlatSpec
.
For example, this method enables syntax such as the following in FlatSpec
and fixture.FlatSpec
:
"A Stack (when empty)" must "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 leftSideString, the verb string
"must"
, and right, and returns the result.
This method enables syntax such as the following:
This method enables syntax such as the following:
string must endWith regex ("world") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string must startWith regex ("hello") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string must include regex ("hi") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
file must not (exist) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
file must exist ^
This method enables syntax such as the following:
This method enables syntax such as the following:
xs must contain oneOf (1, 2, 3) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result must have length (3) ^ result must have size (3) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result must be a aMatcher ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result must === (100 +- 1) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
a must === (b) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result must not equal (3) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result must (equal (expected) and have length 3) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result must equal (3) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result must be (3) ^
This method enables the following syntax, where excellentRead
refers to a BePropertyMatcher[Book]
:
This method enables the following syntax, where excellentRead
refers to a BePropertyMatcher[Book]
:
programmingInScala mustBe an (excellentRead) ^
This method enables the following syntax, where goodRead
refers to a BePropertyMatcher[Book]
:
This method enables the following syntax, where goodRead
refers to a BePropertyMatcher[Book]
:
programmingInScala mustBe a (goodRead) ^
This method enables the following syntax, where excellentRead
refers to a BePropertyMatcher[Book]
:
This method enables the following syntax, where excellentRead
refers to a BePropertyMatcher[Book]
:
programmingInScala mustBe excellentRead ^
This method enables the following syntax:
This method enables the following syntax:
list mustBe an ('empty) ^
This method enables the following syntax:
This method enables the following syntax:
list mustBe a ('empty) ^
This method enables the following syntax:
This method enables the following syntax:
list mustBe 'empty ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe theSameInstanceAs (anotherObject) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe null ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe defined ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe empty ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe writable ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe readable ^
This method enables syntax such as the following:
This method enables syntax such as the following:
aDouble mustBe an [Book] ^
This method enables syntax such as the following:
This method enables syntax such as the following:
aDouble mustBe a [Book] ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe sorted ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe 7.1 +- 0.2 ^
This method enables the following syntax, where odd
refers to a BeMatcher[Int]
:
This method enables the following syntax, where odd
refers to a BeMatcher[Int]
:
testing 1 mustBe odd ^
This method enables syntax such as the following:
This method enables syntax such as the following:
8 mustBe >= (7) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
5 mustBe <= (7) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
8 mustBe > (7) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
5 mustBe < (7) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
aDouble mustBe 8.8 ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustEqual null ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustEqual 7.1 +- 0.2 ^
This method enables syntax such as the following:
This method enables syntax such as the following:
a mustEqual b ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot typeCheck ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot compile ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot fullyMatch regex ("""(-)?(\d+)(\.\d*)?""") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot include regex ("hi") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot endWith regex ("world") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot startWith regex ("hello") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
file mustNot exist ^
This method enables syntax such as the following:
This method enables syntax such as the following:
xs mustNot contain (oneOf (1, 2, 3)) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustNot have length (3) ^ result mustNot have size (3) ^ exception mustNot have message ("file not found") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustNot (be readable) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustNot (be (3)) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustNot be (3) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string must fullyMatch regex ("a(b*)c" withGroup "bb") ^
This method enables syntax such as the following:
This method enables syntax such as the following:
string must fullyMatch regex ("a(b*)(c*)" withGroups ("bb", "cc")) ^
This class is part of the ScalaTest matchers DSL. Please see the documentation for
Matchers
for an overview of the matchers DSL.This class is used in conjunction with an implicit conversion to enable
must
methods to be invoked onString
s.