|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hamcrest.BaseMatcher<T> org.hamcrest.TypeSafeMatcher<java.lang.String> org.hamcrest.core.SubstringMatcher org.hamcrest.core.StringContains
public class StringContains
Tests if the argument is a string that contains a substring.
Field Summary |
---|
Fields inherited from class org.hamcrest.core.SubstringMatcher |
---|
substring |
Constructor Summary | |
---|---|
StringContains(java.lang.String substring)
|
Method Summary | |
---|---|
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()
|
Methods inherited from class org.hamcrest.core.SubstringMatcher |
---|
describeMismatchSafely, describeTo, matchesSafely |
Methods inherited from class org.hamcrest.TypeSafeMatcher |
---|
describeMismatch, matches |
Methods inherited from class org.hamcrest.BaseMatcher |
---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StringContains(java.lang.String substring)
Method Detail |
---|
protected boolean evalSubstringOf(java.lang.String s)
evalSubstringOf
in class SubstringMatcher
protected java.lang.String relationship()
relationship
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 string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |