StringMatchers

The StringMatchers trait provides matchers which are applicable to String objects

Companion:
object
class Object
trait Matchable
class Any
object BeMatching.type
trait Matchers
object Matchers.type
object MustMatchers.type
object MustThrownMatchers.type
object ShouldMatchers.type
object StringMatchers.type

Type members

Classlikes

class FindMatcher(t: => String) extends Matcher[String]

Matcher to find if the regexp a is found inside b. This matcher can be specialized to a FindMatcherWithGroups which will also check the found groups

Matcher to find if the regexp a is found inside b. This matcher can be specialized to a FindMatcherWithGroups which will also check the found groups

class FindMatcherPattern(p: Pattern) extends FindMatcher

Matcher to find if the pattern p is found inside b.

Matcher to find if the pattern p is found inside b.

class FindMatcherPatternWithGroups(p: Pattern, groups: String*) extends FindMatcherWithGroups

Matcher to find if the pattern p is found inside b.

Matcher to find if the pattern p is found inside b.

class FindMatcherRegex(r: Regex) extends FindMatcherPattern

Matcher to find if the Regex r is found inside b.

Matcher to find if the Regex r is found inside b.

class FindMatcherWithGroups(t: => String, groups: String*) extends Matcher[String]

Matcher to find if the regexp a is found inside b. This matcher checks if the found groups are really the ones expected

Matcher to find if the regexp a is found inside b. This matcher checks if the found groups are really the ones expected

Value members

Concrete methods

def !=/(s: String): Matcher[String]

matches if a.toLowerCase.trim != b.toLowerCase.trim

matches if a.toLowerCase.trim != b.toLowerCase.trim

def ==/(s: String): Matcher[String]

matches if a.toLowerCase.trim = b.toLowerCase.trim

matches if a.toLowerCase.trim = b.toLowerCase.trim

def =~[T](t: T)(using evidence$5: MatchingExpression[T]): Matcher[String]

alias for beMatching but matching just a fragment of the string

alias for beMatching but matching just a fragment of the string

def beMatching[T](t: => T)(using evidence$2: MatchingExpression[T]): Matcher[String]

matches if b matches the regular expression a

matches if b matches the regular expression a

def beMatchingWithPart[T](t: T)(using evidence$4: MatchingExpression[T]): Matcher[String]

alias for beMatching but matching just a fragment of the string

alias for beMatching but matching just a fragment of the string

def be_!=/(a: String): Matcher[String]

matches if a.toLowerCase.trim != b.toLowerCase.trim

matches if a.toLowerCase.trim != b.toLowerCase.trim

def be_==/(a: String): Matcher[String]

matches if a.toLowerCase.trim = b.toLowerCase.trim

matches if a.toLowerCase.trim = b.toLowerCase.trim

def contain(t: String): Matcher[String]

matches if (b contains a)

matches if (b contains a)

def contain(t: Char): Matcher[String]

matches if (b contains a)

matches if (b contains a)

def endWith(t: => String): Matcher[String]

matches if b.endsWith(a)

matches if b.endsWith(a)

def find(a: => String): FindMatcher

matches if the regexp a is found inside b

matches if the regexp a is found inside b

def find(p: Pattern): FindMatcherPattern

matches if the pattern p is found inside b

matches if the pattern p is found inside b

def find(r: Regex): FindMatcherRegex

matches if the regexp r is found inside b

matches if the regexp r is found inside b

def matching[T](t: => T)(using evidence$3: MatchingExpression[T]): Matcher[String]

alias to use with contain

alias to use with contain

def startWith(a: String): Matcher[String]

matches if b.startsWith(a)

matches if b.startsWith(a)

Extensions

Extensions

extension (m: AdaptableMatcher[String])

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher