StringMatchers

org.specs2.matcher.StringMatchers
See theStringMatchers companion object

The StringMatchers trait provides matchers which are applicable to String objects

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object BeMatching.type
trait Matchers
object Matchers.type
trait MustMatchers
object MustMatchers.type
object MustThrownMatchers.type
object ShouldMatchers.type
object ShouldThrownMatchers.type
object StringMatchers.type
Show all

Members list

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

Attributes

Supertypes
trait Matcher[String]
class Object
trait Matchable
class Any
Known subtypes
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.

Attributes

Supertypes
class FindMatcher
trait Matcher[String]
class Object
trait Matchable
class Any
Known subtypes
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.

Attributes

Supertypes
trait Matcher[String]
class Object
trait Matchable
class Any
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.

Attributes

Supertypes
class FindMatcher
trait Matcher[String]
class Object
trait Matchable
class Any
Show all
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

Attributes

Supertypes
trait Matcher[String]
class Object
trait Matchable
class Any
Known subtypes

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

Attributes

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

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

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

Attributes

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

Attributes

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

Attributes

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

Attributes

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

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

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

Attributes

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

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

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

Attributes

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

matches if (b contains a)

matches if (b contains a)

Attributes

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

matches if (b contains a)

matches if (b contains a)

Attributes

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

matches if b.endsWith(a)

matches if b.endsWith(a)

Attributes

def find(a: => String): FindMatcher

matches if the regexp a is found inside b

matches if the regexp a is found inside b

Attributes

def find(p: Pattern): FindMatcherPattern

matches if the pattern p is found inside b

matches if the pattern p is found inside b

Attributes

def find(r: Regex): FindMatcherRegex

matches if the regexp r is found inside b

matches if the regexp r is found inside b

Attributes

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

alias to use with contain

alias to use with contain

Attributes

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

matches if b.startsWith(a)

matches if b.startsWith(a)

Attributes

Extensions

Extensions

extension (m: AdaptableMatcher[String])(m: AdaptableMatcher[String])

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

Attributes

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

Attributes

def trimmed: AdaptableMatcher[String]

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher

Attributes