org.scalatest.matchers.MustMatchers

StringMustWrapper

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 Strings.

Linear Supertypes
MustMatchers.StringMustWrapperForVerb, AnyMustWrapper[String], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StringMustWrapper
  2. StringMustWrapperForVerb
  3. AnyMustWrapper
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StringMustWrapper(left: String)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def asAny: Any

    Definition Classes
    AnyMustWrapper
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. val left: String

  16. def must(notWord: NotWord): ResultOfNotWordForString

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string must not have length (3)
           ^
    

    Definition Classes
    StringMustWrapperAnyMustWrapper
  17. 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*)?""")
           ^
    

  18. def must(endWithWord: EndWithWord): ResultOfEndWithWordForString

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string must endWith regex ("world")
           ^
    

  19. def must(startWithWord: StartWithWord): ResultOfStartWithWordForString

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string must startWith regex ("hello")
           ^
    

  20. def must(includeWord: IncludeWord): ResultOfIncludeWordForString

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string must include regex ("hi")
           ^
    

  21. def must(resultOfAfterWordApplication: ResultOfAfterWordApplication)(implicit fun: (String, String, ResultOfAfterWordApplication) ⇒ Unit): Unit

    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 left, the verb string "must", and the ResultOfAfterWordApplication passed to must.

    Definition Classes
    StringMustWrapperForVerb
  22. def must(right: ⇒ Unit)(implicit fun: StringVerbBlockRegistration): Unit

    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 left, the verb string "must", and the right by-name parameter transformed into a no-arg function.

    Definition Classes
    StringMustWrapperForVerb
  23. def must(right: BehaveWord)(implicit fun: (String) ⇒ BehaveWord): BehaveWord

    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 left, and returns the result.

    Definition Classes
    StringMustWrapperForVerb
  24. def must(right: String)(implicit fun: (String, String, String) ⇒ ResultOfStringPassedToVerb): ResultOfStringPassedToVerb

    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 left, the verb string "must", and right, and returns the result.

    Definition Classes
    StringMustWrapperForVerb
  25. def must(newContainWord: NewContainWord): ResultOfNewContainWord[String]

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    map must contain key (10)
        ^
    

    Definition Classes
    AnyMustWrapper
  26. def must(haveWord: HaveWord)(implicit ev: Extent[String]): 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
  27. 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
  28. def must(inv: TripleEqualsInvocationOnInterval[String])(implicit ev: Numeric[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result must === (100 +- 1)
           ^
    

    Definition Classes
    AnyMustWrapper
  29. def must[U](inv: TripleEqualsInvocation[U])(implicit constraint: EqualityConstraint[String, U]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    a must === (b)
           ^
    

    Definition Classes
    AnyMustWrapper
  30. def must[TYPECLASS1[_], TYPECLASS2[_]](rightMatcherFactory2: MatcherFactory2[String, TYPECLASS1, TYPECLASS2])(implicit typeClass1: TYPECLASS1[String], typeClass2: TYPECLASS2[String]): Unit

    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
  31. def must[TYPECLASS1[_]](rightMatcherFactory1: MatcherFactory1[String, TYPECLASS1])(implicit typeClass1: TYPECLASS1[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result must equal (3)
           ^
    

    Definition Classes
    AnyMustWrapper
  32. def must(rightMatcherX1: Matcher[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result must be (3)
           ^
    

    Definition Classes
    AnyMustWrapper
  33. def mustBe[U >: String](resultOfAnWordApplication: ResultOfAnWordToBePropertyMatcherApplication[U])(implicit ev: <:<[String, AnyRef]): Unit

    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)
                       ^
    

    Definition Classes
    AnyMustWrapper
  34. def mustBe[U >: String](resultOfAWordApplication: ResultOfAWordToBePropertyMatcherApplication[U])(implicit ev: <:<[String, AnyRef]): Unit

    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)
                       ^
    

    Definition Classes
    AnyMustWrapper
  35. def mustBe(bePropertyMatcher: BePropertyMatcher[String])(implicit ev: <:<[String, AnyRef]): Unit

    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
                       ^
    

    Definition Classes
    AnyMustWrapper
  36. def mustBe(resultOfAnWordApplication: ResultOfAnWordToSymbolApplication)(implicit ev: <:<[String, AnyRef]): Unit

    This method enables the following syntax:

    This method enables the following syntax:

    list mustBe an ('empty)
         ^
    

    Definition Classes
    AnyMustWrapper
  37. def mustBe(resultOfAWordApplication: ResultOfAWordToSymbolApplication)(implicit ev: <:<[String, AnyRef]): Unit

    This method enables the following syntax:

    This method enables the following syntax:

    list mustBe a ('empty)
         ^
    

    Definition Classes
    AnyMustWrapper
  38. def mustBe(symbol: Symbol)(implicit ev: <:<[String, AnyRef]): Unit

    This method enables the following syntax:

    This method enables the following syntax:

    list mustBe 'empty
         ^
    

    Definition Classes
    AnyMustWrapper
  39. def mustBe(resultOfSameInstanceAsApplication: ResultOfTheSameInstanceAsApplication)(implicit ev: <:<[String, AnyRef]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result mustBe theSameInstanceAs (anotherObject)
           ^
    

    Definition Classes
    AnyMustWrapper
  40. def mustBe(right: Null)(implicit ev: <:<[String, AnyRef]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result mustBe null
           ^
    

    Definition Classes
    AnyMustWrapper
  41. def mustBe(interval: Interval[String]): Unit

    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
  42. def mustBe(beMatcher: BeMatcher[String]): Unit

    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
      ^
    

    Definition Classes
    AnyMustWrapper
  43. def mustBe(comparison: ResultOfGreaterThanOrEqualToComparison[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    8 mustBe >= (7)
      ^
    

    Definition Classes
    AnyMustWrapper
  44. def mustBe(comparison: ResultOfLessThanOrEqualToComparison[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    5 mustBe <= (7)
      ^
    

    Definition Classes
    AnyMustWrapper
  45. def mustBe(comparison: ResultOfGreaterThanComparison[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    8 mustBe > (7)
      ^
    

    Definition Classes
    AnyMustWrapper
  46. def mustBe(comparison: ResultOfLessThanComparison[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    5 mustBe < (7)
      ^
    

    Definition Classes
    AnyMustWrapper
  47. def mustBe(right: String): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    aDouble mustBe 8.8
            ^
    

    Definition Classes
    AnyMustWrapper
  48. def mustEqual(right: Null)(implicit ev: <:<[String, AnyRef]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result mustEqual null
           ^
    

    Definition Classes
    AnyMustWrapper
  49. def mustEqual(interval: Interval[String]): Unit

    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
  50. def mustEqual(right: Any)(implicit equality: Equality[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    a mustEqual b
      ^
    

    Definition Classes
    AnyMustWrapper
  51. def mustNot(includeWord: IncludeWord): ResultOfIncludeWordForString

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string mustNot include regex ("hi")
           ^
    

  52. def mustNot(endWithWord: EndWithWord): ResultOfEndWithWordForString

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string mustNot endWith regex ("world")
           ^
    

  53. def mustNot(startWithWord: StartWithWord): ResultOfStartWithWordForString

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string mustNot startWith regex ("hello")
           ^
    

  54. 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*)?""")
           ^
    

  55. def mustNot(rightMatcherX1: Matcher[String]): Unit

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result mustNot (be (3))
           ^
    

    Definition Classes
    AnyMustWrapper
  56. 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
  57. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  58. final def notify(): Unit

    Definition Classes
    AnyRef
  59. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  60. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  61. def toString(): String

    Definition Classes
    AnyRef → Any
  62. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  63. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  64. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  65. 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")
                                             ^
    

  66. 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"))
                                             ^
    

Inherited from MustMatchers.StringMustWrapperForVerb

Inherited from AnyMustWrapper[String]

Inherited from AnyRef

Inherited from Any

Ungrouped