final class StringMustWrapper extends AnyMustWrapper[String] with StringMustWrapperForVerb
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 on String
s.
- Source
- Matchers.scala
- Alphabetic
- By Inheritance
- StringMustWrapper
- StringMustWrapperForVerb
- AnyMustWrapper
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new StringMustWrapper(leftSideString: String, pos: Position, prettifier: Prettifier)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val leftSideString: String
- Definition Classes
- StringMustWrapper → StringMustWrapperForVerb
- val leftSideValue: String
- Definition Classes
- AnyMustWrapper
- macro def must(compileWord: CompileWord)(implicit pos: Position): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
string must compile ^
- def must(fullyMatchWord: FullyMatchWord): ResultOfFullyMatchWordForString
This method enables syntax such as the following:
This method enables syntax such as the following:
string must fullyMatch regex ("""(-)?(\d+)(\.\d*)?""") ^
- def must(resultOfAfterWordApplication: ResultOfAfterWordApplication)(implicit swawr: SubjectWithAfterWordRegistration): Unit
Supports the registration of subject descriptions with after words in
WordSpec
andfixture.WordSpec
.Supports the registration of subject descriptions with after words in
WordSpec
andfixture.WordSpec
.For example, this method enables syntax such as the following in
WordSpec
andfixture.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 aResultOfAfterWordApplication
and results inUnit
. This method simply invokes this function, passing in leftSideString, the verb string"must"
, and theResultOfAfterWordApplication
passed tomust
.- Definition Classes
- StringMustWrapperForVerb
- def must(right: => Unit)(implicit fun: StringVerbBlockRegistration): Unit
Supports the registration of subject descriptions in
WordSpec
andfixture.WordSpec
.Supports the registration of subject descriptions in
WordSpec
andfixture.WordSpec
.For example, this method enables syntax such as the following in
WordSpec
andfixture.WordSpec
:"A Stack (when empty)" must { ... ^
WordSpec
passes in a function via the implicit parameter of typeStringVerbBlockRegistration
, a function that takes two strings and a no-arg function and results inUnit
. 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.- Definition Classes
- StringMustWrapperForVerb
- def must(right: BehaveWord)(implicit svbli: StringVerbBehaveLikeInvocation): BehaveWord
Supports shared test registration in
FlatSpec
andfixture.FlatSpec
.Supports shared test registration in
FlatSpec
andfixture.FlatSpec
.For example, this method enables syntax such as the following in
FlatSpec
andfixture.FlatSpec
:"A Stack (with one item)" must behave like nonEmptyStack(stackWithOneItem, lastValuePushed) ^
FlatSpec
andfixture.FlatSpec
passes in a function via the implicit parameter that takes a string and results in aBehaveWord
. This method simply invokes this function, passing in leftSideString, and returns the result.- Definition Classes
- StringMustWrapperForVerb
- def must(right: String)(implicit svsi: StringVerbStringInvocation): ResultOfStringPassedToVerb
Supports test registration in
FlatSpec
andfixture.FlatSpec
.Supports test registration in
FlatSpec
andfixture.FlatSpec
.For example, this method enables syntax such as the following in
FlatSpec
andfixture.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 aResultOfStringPassedToVerb
. This method simply invokes this function, passing in leftSideString, the verb string"must"
, and right, and returns the result.- Definition Classes
- StringMustWrapperForVerb
- def must(endWithWord: EndWithWord)(implicit ev: <:<[String, String]): ResultOfEndWithWordForString
This method enables syntax such as the following:
This method enables syntax such as the following:
string must endWith regex ("world") ^
- Definition Classes
- AnyMustWrapper
- def must(startWithWord: StartWithWord)(implicit ev: <:<[String, String]): ResultOfStartWithWordForString
This method enables syntax such as the following:
This method enables syntax such as the following:
string must startWith regex ("hello") ^
- Definition Classes
- AnyMustWrapper
- def must(includeWord: IncludeWord)(implicit ev: <:<[String, String]): ResultOfIncludeWordForString
This method enables syntax such as the following:
This method enables syntax such as the following:
string must include regex ("hi") ^
- Definition Classes
- AnyMustWrapper
- def must(notExist: ResultOfNotExist)(implicit existence: Existence[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
file must not (exist) ^
- Definition Classes
- AnyMustWrapper
- def must(existWord: ExistWord)(implicit existence: Existence[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
file must exist ^
- Definition Classes
- AnyMustWrapper
- def must(containWord: ContainWord): ResultOfContainWord[String]
This method enables syntax such as the following:
This method enables syntax such as the following:
xs must contain oneOf (1, 2, 3) ^
- Definition Classes
- AnyMustWrapper
- def must(haveWord: HaveWord): ResultOfHaveWordForExtent[String]
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) ^
- Definition Classes
- AnyMustWrapper
- def must(beWord: BeWord): ResultOfBeWordForAny[String]
This method enables syntax such as the following:
This method enables syntax such as the following:
result must be a aMatcher ^
- Definition Classes
- AnyMustWrapper
- def must(inv: TripleEqualsInvocationOnSpread[String])(implicit ev: Numeric[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result must === (100 +- 1) ^
- Definition Classes
- AnyMustWrapper
- def must[U](inv: TripleEqualsInvocation[U])(implicit constraint: CanEqual[String, U]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
a must === (b) ^
- Definition Classes
- AnyMustWrapper
- def must(notWord: NotWord): ResultOfNotWordForAny[String]
This method enables syntax such as the following:
This method enables syntax such as the following:
result must not equal (3) ^
- Definition Classes
- AnyMustWrapper
- def must[TYPECLASS1[_], TYPECLASS2[_]](rightMatcherFactory2: MatcherFactory2[String, TYPECLASS1, TYPECLASS2])(implicit typeClass1: TYPECLASS1[String], typeClass2: TYPECLASS2[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result must (equal (expected) and have length 3) ^
- Definition Classes
- AnyMustWrapper
- def must[TYPECLASS1[_]](rightMatcherFactory1: MatcherFactory1[String, TYPECLASS1])(implicit typeClass1: TYPECLASS1[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result must equal (3) ^
- Definition Classes
- AnyMustWrapper
- def must(rightMatcherX1: Matcher[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result must be (3) ^
- Definition Classes
- AnyMustWrapper
- def mustBe[U >: String](resultOfAnWordApplication: ResultOfAnWordToBePropertyMatcherApplication[U])(implicit ev: <:<[String, AnyRef]): Assertion
This method enables the following syntax, where
excellentRead
refers to aBePropertyMatcher[Book]
:This method enables the following syntax, where
excellentRead
refers to aBePropertyMatcher[Book]
:programmingInScala mustBe an (excellentRead) ^
- Definition Classes
- AnyMustWrapper
- def mustBe[U >: String](resultOfAWordApplication: ResultOfAWordToBePropertyMatcherApplication[U])(implicit ev: <:<[String, AnyRef]): Assertion
This method enables the following syntax, where
goodRead
refers to aBePropertyMatcher[Book]
:This method enables the following syntax, where
goodRead
refers to aBePropertyMatcher[Book]
:programmingInScala mustBe a (goodRead) ^
- Definition Classes
- AnyMustWrapper
- def mustBe(bePropertyMatcher: BePropertyMatcher[String])(implicit ev: <:<[String, AnyRef]): Assertion
This method enables the following syntax, where
excellentRead
refers to aBePropertyMatcher[Book]
:This method enables the following syntax, where
excellentRead
refers to aBePropertyMatcher[Book]
:programmingInScala mustBe excellentRead ^
- Definition Classes
- AnyMustWrapper
- def mustBe(resultOfAnWordApplication: ResultOfAnWordToSymbolApplication)(implicit toAnyRef: <:<[String, AnyRef]): Assertion
This method enables the following syntax:
This method enables the following syntax:
list mustBe an ('empty) ^
- Definition Classes
- AnyMustWrapper
- def mustBe(resultOfAWordApplication: ResultOfAWordToSymbolApplication)(implicit toAnyRef: <:<[String, AnyRef]): Assertion
This method enables the following syntax:
This method enables the following syntax:
list mustBe a ('empty) ^
- Definition Classes
- AnyMustWrapper
- def mustBe(symbol: Symbol)(implicit toAnyRef: <:<[String, AnyRef]): Assertion
This method enables the following syntax:
This method enables the following syntax:
list mustBe 'empty ^
- Definition Classes
- AnyMustWrapper
- def mustBe(resultOfSameInstanceAsApplication: ResultOfTheSameInstanceAsApplication)(implicit toAnyRef: <:<[String, AnyRef]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe theSameInstanceAs (anotherObject) ^
- Definition Classes
- AnyMustWrapper
- def mustBe(right: Null)(implicit ev: <:<[String, AnyRef]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe null ^
- Definition Classes
- AnyMustWrapper
- def mustBe(right: DefinedWord)(implicit definition: Definition[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe defined ^
- Definition Classes
- AnyMustWrapper
- def mustBe(right: EmptyWord)(implicit emptiness: Emptiness[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe empty ^
- Definition Classes
- AnyMustWrapper
- def mustBe(right: WritableWord)(implicit writability: Writability[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe writable ^
- Definition Classes
- AnyMustWrapper
- def mustBe(right: ReadableWord)(implicit readability: Readability[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe readable ^
- Definition Classes
- AnyMustWrapper
- macro def mustBe(anType: ResultOfAnTypeInvocation[_]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
aDouble mustBe an [Book] ^
- Definition Classes
- AnyMustWrapper
- macro def mustBe(aType: ResultOfATypeInvocation[_]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
aDouble mustBe a [Book] ^
- Definition Classes
- AnyMustWrapper
- def mustBe(right: SortedWord)(implicit sortable: Sortable[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe sorted ^
- Definition Classes
- AnyMustWrapper
- def mustBe(spread: Spread[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustBe 7.1 +- 0.2 ^
- Definition Classes
- AnyMustWrapper
- def mustBe(beMatcher: BeMatcher[String]): Assertion
This method enables the following syntax, where
odd
refers to aBeMatcher[Int]
:This method enables the following syntax, where
odd
refers to aBeMatcher[Int]
:testing 1 mustBe odd ^
- Definition Classes
- AnyMustWrapper
- def mustBe(comparison: ResultOfGreaterThanOrEqualToComparison[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
8 mustBe >= (7) ^
- Definition Classes
- AnyMustWrapper
- def mustBe(comparison: ResultOfLessThanOrEqualToComparison[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
5 mustBe <= (7) ^
- Definition Classes
- AnyMustWrapper
- def mustBe(comparison: ResultOfGreaterThanComparison[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
8 mustBe > (7) ^
- Definition Classes
- AnyMustWrapper
- def mustBe(comparison: ResultOfLessThanComparison[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
5 mustBe < (7) ^
- Definition Classes
- AnyMustWrapper
- def mustBe(right: Any): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
aDouble mustBe 8.8 ^
- Definition Classes
- AnyMustWrapper
- def mustEqual(right: Null)(implicit ev: <:<[String, AnyRef]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustEqual null ^
- Definition Classes
- AnyMustWrapper
- def mustEqual(spread: Spread[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustEqual 7.1 +- 0.2 ^
- Definition Classes
- AnyMustWrapper
- def mustEqual(right: Any)(implicit equality: Equality[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
a mustEqual b ^
- Definition Classes
- AnyMustWrapper
- macro def mustNot(typeCheckWord: TypeCheckWord)(implicit pos: Position): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot typeCheck ^
- macro def mustNot(compileWord: CompileWord)(implicit pos: Position): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot compile ^
- def mustNot(fullyMatchWord: FullyMatchWord): ResultOfFullyMatchWordForString
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot fullyMatch regex ("""(-)?(\d+)(\.\d*)?""") ^
- def mustNot(includeWord: IncludeWord)(implicit ev: <:<[String, String]): ResultOfIncludeWordForString
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot include regex ("hi") ^
- Definition Classes
- AnyMustWrapper
- def mustNot(endWithWord: EndWithWord)(implicit ev: <:<[String, String]): ResultOfEndWithWordForString
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot endWith regex ("world") ^
- Definition Classes
- AnyMustWrapper
- def mustNot(startWithWord: StartWithWord)(implicit ev: <:<[String, String]): ResultOfStartWithWordForString
This method enables syntax such as the following:
This method enables syntax such as the following:
string mustNot startWith regex ("hello") ^
- Definition Classes
- AnyMustWrapper
- def mustNot(existWord: ExistWord)(implicit existence: Existence[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
file mustNot exist ^
- Definition Classes
- AnyMustWrapper
- def mustNot(contain: ContainWord): ResultOfContainWord[String]
This method enables syntax such as the following:
This method enables syntax such as the following:
xs mustNot contain (oneOf (1, 2, 3)) ^
- Definition Classes
- AnyMustWrapper
- def mustNot(haveWord: HaveWord): ResultOfHaveWordForExtent[String]
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") ^
- Definition Classes
- AnyMustWrapper
- def mustNot[TYPECLASS1[_]](rightMatcherFactory1: MatcherFactory1[String, TYPECLASS1])(implicit typeClass1: TYPECLASS1[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustNot (be readable) ^
- Definition Classes
- AnyMustWrapper
- def mustNot(rightMatcherX1: Matcher[String]): Assertion
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustNot (be (3)) ^
- Definition Classes
- AnyMustWrapper
- def mustNot(beWord: BeWord): ResultOfBeWordForAny[String]
This method enables syntax such as the following:
This method enables syntax such as the following:
result mustNot be (3) ^
- Definition Classes
- AnyMustWrapper
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val pos: Position
- Definition Classes
- AnyMustWrapper
- val prettifier: Prettifier
- Definition Classes
- AnyMustWrapper
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withGroup(group: String): RegexWithGroups
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") ^
- def withGroups(groups: String*): RegexWithGroups
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")) ^