public class StringContains extends SubstringMatcher
substring
Constructor and Description |
---|
StringContains(boolean ignoringCase,
java.lang.String substring) |
Modifier and Type | Method and 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. |
static Matcher<java.lang.String> |
containsStringIgnoringCase(java.lang.String substring)
Creates a matcher that matches if the examined
String contains the specified
String anywhere, ignoring case. |
protected boolean |
evalSubstringOf(java.lang.String s) |
converted, describeMismatchSafely, describeTo, matchesSafely
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
public StringContains(boolean ignoringCase, java.lang.String substring)
protected boolean evalSubstringOf(java.lang.String s)
evalSubstringOf
in class SubstringMatcher
public 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 stringpublic static Matcher<java.lang.String> containsStringIgnoringCase(java.lang.String substring)
String
contains the specified
String
anywhere, ignoring case.
For example:
assertThat("myStringOfNote", containsStringIgnoringCase("Ring"))
substring
- the substring that the returned matcher will expect to find within any examined string