Matcher<java.lang.String>, SelfDescribingpublic class StringContains extends SubstringMatcher
substring| Constructor | Description |
|---|---|
StringContains(java.lang.String substring) |
| Modifier and Type | Method | Description |
|---|---|---|
static Matcher<java.lang.String> |
containsString(java.lang.String substring) |
Creates a matcher that matches if the examined
String contains the specified
String anywhere. |
protected boolean |
evalSubstringOf(java.lang.String s) |
|
protected java.lang.String |
relationship() |
_dont_implement_Matcher___instead_extend_BaseMatcher_, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescribeMismatchSafely, describeTo, matchesSafelydescribeMismatch, matchesprotected boolean evalSubstringOf(java.lang.String s)
evalSubstringOf in class SubstringMatcherprotected java.lang.String relationship()
relationship in class SubstringMatcherpublic static Matcher<java.lang.String> containsString(java.lang.String substring)
String contains the specified
String anywhere.
For example:
assertThat("myStringOfNote", containsString("ring"))substring - the substring that the returned matcher will expect to find within any examined string