infix fun <T : CharSequence> Expect<T>.containsRegex(pattern: String): Expect<T>
Expects that the subject of the assertion (a CharSequence) contains a sequence which matches the given regular expression pattern.
It is a shortcut for contains o atLeast 1 regex pattern
.
pattern
- The pattern which is expected to have a match against the input of the search.
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
This assertion container to support a fluent API.