Class

org.scalatest.Matchers

StringShouldWrapper

Related Doc: package Matchers

Permalink

final class StringShouldWrapper extends AnyShouldWrapper[String] with StringShouldWrapperForVerb

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 should methods to be invoked on Strings.

Source
Matchers.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StringShouldWrapper
  2. StringShouldWrapperForVerb
  3. AnyShouldWrapper
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StringShouldWrapper(leftSideString: String)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  12. val leftSideString: String

    Permalink
  13. val leftSideValue: String

    Permalink
    Definition Classes
    AnyShouldWrapper
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. macro def should(compileWord: CompileWord): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should compile
           ^
    

  18. def should(fullyMatchWord: FullyMatchWord): ResultOfFullyMatchWordForString

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should fullyMatch regex ("""(-)?(\d+)(\.\d*)?""")
           ^
    

  19. def should(resultOfAfterWordApplication: ResultOfAfterWordApplication)(implicit fun: (String, String, ResultOfAfterWordApplication) ⇒ Unit): Unit

    Permalink

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

    Definition Classes
    StringShouldWrapperForVerb
  20. def should(right: ⇒ Unit)(implicit fun: StringVerbBlockRegistration): Unit

    Permalink

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

    Definition Classes
    StringShouldWrapperForVerb
  21. def should(right: BehaveWord)(implicit fun: (String) ⇒ BehaveWord): BehaveWord

    Permalink

    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)" should 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.

    Definition Classes
    StringShouldWrapperForVerb
  22. def should(right: String)(implicit fun: (String, String, String) ⇒ ResultOfStringPassedToVerb): ResultOfStringPassedToVerb

    Permalink

    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)" 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 leftSideString, the verb string "should", and right, and returns the result.

    Definition Classes
    StringShouldWrapperForVerb
  23. def should(endWithWord: EndWithWord)(implicit ev: <:<[String, String]): ResultOfEndWithWordForString

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should endWith regex ("world")
           ^
    

    Definition Classes
    AnyShouldWrapper
  24. def should(startWithWord: StartWithWord)(implicit ev: <:<[String, String]): ResultOfStartWithWordForString

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should startWith regex ("hello")
           ^
    

    Definition Classes
    AnyShouldWrapper
  25. def should(includeWord: IncludeWord)(implicit ev: <:<[String, String]): ResultOfIncludeWordForString

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should include regex ("hi")
           ^
    

    Definition Classes
    AnyShouldWrapper
  26. def should(notExist: ResultOfNotExist)(implicit existence: Existence[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    file should not (exist)
         ^
    

    Definition Classes
    AnyShouldWrapper
  27. def should(existWord: ExistWord)(implicit existence: Existence[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    file should exist
         ^
    

    Definition Classes
    AnyShouldWrapper
  28. def should(containWord: ContainWord): ResultOfContainWord[String]

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    xs should contain oneOf (1, 2, 3)
       ^
    

    Definition Classes
    AnyShouldWrapper
  29. def should(haveWord: HaveWord): ResultOfHaveWordForExtent[String]

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result should have length (3)
           ^
    result should have size (3)
           ^
    

    Definition Classes
    AnyShouldWrapper
  30. def should(beWord: BeWord): ResultOfBeWordForAny[String]

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result should be a aMatcher
           ^
    

    Definition Classes
    AnyShouldWrapper
  31. def should(inv: TripleEqualsInvocationOnSpread[String])(implicit ev: Numeric[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

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

    Definition Classes
    AnyShouldWrapper
  32. def should[U](inv: TripleEqualsInvocation[U])(implicit constraint: CanEqual[String, U]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    a should === (b)
           ^
    

    Definition Classes
    AnyShouldWrapper
  33. def should(notWord: NotWord): ResultOfNotWordForAny[String]

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result should not equal (3)
           ^
    

    Definition Classes
    AnyShouldWrapper
  34. def should[TYPECLASS1[_], TYPECLASS2[_]](rightMatcherFactory2: MatcherFactory2[String, TYPECLASS1, TYPECLASS2])(implicit typeClass1: TYPECLASS1[String], typeClass2: TYPECLASS2[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result should (equal (expected) and have length 3)
           ^
    

    Definition Classes
    AnyShouldWrapper
  35. def should[TYPECLASS1[_]](rightMatcherFactory1: MatcherFactory1[String, TYPECLASS1])(implicit typeClass1: TYPECLASS1[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result should equal (3)
           ^
    

    Definition Classes
    AnyShouldWrapper
  36. def should(rightMatcherX1: Matcher[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result should be (3)
           ^
    

    Definition Classes
    AnyShouldWrapper
  37. def shouldBe[U >: String](resultOfAnWordApplication: ResultOfAnWordToBePropertyMatcherApplication[U])(implicit ev: <:<[String, AnyRef]): Assertion

    Permalink

    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 shouldBe an (excellentRead)
                       ^
    

    Definition Classes
    AnyShouldWrapper
  38. def shouldBe[U >: String](resultOfAWordApplication: ResultOfAWordToBePropertyMatcherApplication[U])(implicit ev: <:<[String, AnyRef]): Assertion

    Permalink

    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 shouldBe a (goodRead)
                       ^
    

    Definition Classes
    AnyShouldWrapper
  39. def shouldBe(bePropertyMatcher: BePropertyMatcher[String])(implicit ev: <:<[String, AnyRef]): Assertion

    Permalink

    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 shouldBe excellentRead
                       ^
    

    Definition Classes
    AnyShouldWrapper
  40. def shouldBe(resultOfAnWordApplication: ResultOfAnWordToSymbolApplication)(implicit toAnyRef: <:<[String, AnyRef]): Assertion

    Permalink

    This method enables the following syntax:

    This method enables the following syntax:

    list shouldBe an ('empty)
         ^
    

    Definition Classes
    AnyShouldWrapper
  41. def shouldBe(resultOfAWordApplication: ResultOfAWordToSymbolApplication)(implicit toAnyRef: <:<[String, AnyRef]): Assertion

    Permalink

    This method enables the following syntax:

    This method enables the following syntax:

    list shouldBe a ('empty)
         ^
    

    Definition Classes
    AnyShouldWrapper
  42. def shouldBe(symbol: Symbol)(implicit toAnyRef: <:<[String, AnyRef]): Assertion

    Permalink

    This method enables the following syntax:

    This method enables the following syntax:

    list shouldBe 'empty
         ^
    

    Definition Classes
    AnyShouldWrapper
  43. def shouldBe(resultOfSameInstanceAsApplication: ResultOfTheSameInstanceAsApplication)(implicit toAnyRef: <:<[String, AnyRef]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldBe theSameInstanceAs (anotherObject)
           ^
    

    Definition Classes
    AnyShouldWrapper
  44. def shouldBe(right: Null)(implicit ev: <:<[String, AnyRef]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldBe null
           ^
    

    Definition Classes
    AnyShouldWrapper
  45. def shouldBe(right: DefinedWord)(implicit definition: Definition[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldBe defined
           ^
    

    Definition Classes
    AnyShouldWrapper
  46. def shouldBe(right: EmptyWord)(implicit emptiness: Emptiness[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldBe empty
           ^
    

    Definition Classes
    AnyShouldWrapper
  47. def shouldBe(right: WritableWord)(implicit writability: Writability[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldBe writable
           ^
    

    Definition Classes
    AnyShouldWrapper
  48. def shouldBe(right: ReadableWord)(implicit readability: Readability[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldBe readable
           ^
    

    Definition Classes
    AnyShouldWrapper
  49. macro def shouldBe(anType: ResultOfAnTypeInvocation[_]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    aDouble shouldBe an [Book]
            ^
    

    Definition Classes
    AnyShouldWrapper
  50. macro def shouldBe(aType: ResultOfATypeInvocation[_]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    aDouble shouldBe a [Book]
            ^
    

    Definition Classes
    AnyShouldWrapper
  51. def shouldBe(right: SortedWord)(implicit sortable: Sortable[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldBe sorted
           ^
    

    Definition Classes
    AnyShouldWrapper
  52. def shouldBe(spread: Spread[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldBe 7.1 +- 0.2
           ^
    

    Definition Classes
    AnyShouldWrapper
  53. def shouldBe(beMatcher: BeMatcher[String]): Assertion

    Permalink

    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 shouldBe odd
      ^
    

    Definition Classes
    AnyShouldWrapper
  54. def shouldBe(comparison: ResultOfGreaterThanOrEqualToComparison[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    8 shouldBe >= (7)
      ^
    

    Definition Classes
    AnyShouldWrapper
  55. def shouldBe(comparison: ResultOfLessThanOrEqualToComparison[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    5 shouldBe <= (7)
      ^
    

    Definition Classes
    AnyShouldWrapper
  56. def shouldBe(comparison: ResultOfGreaterThanComparison[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    8 shouldBe > (7)
      ^
    

    Definition Classes
    AnyShouldWrapper
  57. def shouldBe(comparison: ResultOfLessThanComparison[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    5 shouldBe < (7)
      ^
    

    Definition Classes
    AnyShouldWrapper
  58. def shouldBe(right: Any): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    aDouble shouldBe 8.8
            ^
    

    Definition Classes
    AnyShouldWrapper
  59. def shouldEqual(right: Null)(implicit ev: <:<[String, AnyRef]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldEqual null
           ^
    

    Definition Classes
    AnyShouldWrapper
  60. def shouldEqual(spread: Spread[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldEqual 7.1 +- 0.2
           ^
    

    Definition Classes
    AnyShouldWrapper
  61. def shouldEqual(right: Any)(implicit equality: Equality[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    a shouldEqual b
      ^
    

    Definition Classes
    AnyShouldWrapper
  62. macro def shouldNot(typeCheckWord: TypeCheckWord): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string shouldNot typeCheck
           ^
    

  63. macro def shouldNot(compileWord: CompileWord): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string shouldNot compile
           ^
    

  64. def shouldNot(fullyMatchWord: FullyMatchWord): ResultOfFullyMatchWordForString

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string shouldNot fullyMatch regex ("""(-)?(\d+)(\.\d*)?""")
           ^
    

  65. def shouldNot(includeWord: IncludeWord)(implicit ev: <:<[String, String]): ResultOfIncludeWordForString

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string shouldNot include regex ("hi")
           ^
    

    Definition Classes
    AnyShouldWrapper
  66. def shouldNot(endWithWord: EndWithWord)(implicit ev: <:<[String, String]): ResultOfEndWithWordForString

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string shouldNot endWith regex ("world")
           ^
    

    Definition Classes
    AnyShouldWrapper
  67. def shouldNot(startWithWord: StartWithWord)(implicit ev: <:<[String, String]): ResultOfStartWithWordForString

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string shouldNot startWith regex ("hello")
           ^
    

    Definition Classes
    AnyShouldWrapper
  68. def shouldNot(existWord: ExistWord)(implicit existence: Existence[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    file shouldNot exist
         ^
    

    Definition Classes
    AnyShouldWrapper
  69. def shouldNot(contain: ContainWord): ResultOfContainWord[String]

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    xs shouldNot contain (oneOf (1, 2, 3))
       ^
    

    Definition Classes
    AnyShouldWrapper
  70. def shouldNot(haveWord: HaveWord): ResultOfHaveWordForExtent[String]

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldNot have length (3)
           ^
    result shouldNot have size (3)
           ^
    exception shouldNot have message ("file not found")
              ^
    

    Definition Classes
    AnyShouldWrapper
  71. def shouldNot[TYPECLASS1[_]](rightMatcherFactory1: MatcherFactory1[String, TYPECLASS1])(implicit typeClass1: TYPECLASS1[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldNot (be readable)
           ^
    

    Definition Classes
    AnyShouldWrapper
  72. def shouldNot(rightMatcherX1: Matcher[String]): Assertion

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldNot (be (3))
           ^
    

    Definition Classes
    AnyShouldWrapper
  73. def shouldNot(beWord: BeWord): ResultOfBeWordForAny[String]

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result shouldNot be (3)
           ^
    

    Definition Classes
    AnyShouldWrapper
  74. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  75. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. def withGroup(group: String): RegexWithGroups

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should fullyMatch regex ("a(b*)c" withGroup "bb")
                                             ^
    

  80. def withGroups(groups: String*): RegexWithGroups

    Permalink

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should fullyMatch regex ("a(b*)(c*)" withGroups ("bb", "cc"))
                                                ^
    

Inherited from AnyShouldWrapper[String]

Inherited from AnyRef

Inherited from Any

Ungrouped