public class StringStartsWith extends SubstringMatcher
substring
Constructor and Description |
---|
StringStartsWith(String substring) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
evalSubstringOf(String s) |
protected String |
relationship() |
static Matcher<String> |
startsWith(String prefix)
|
describeMismatchSafely, describeTo, matchesSafely
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
public StringStartsWith(String substring)
protected boolean evalSubstringOf(String s)
evalSubstringOf
in class SubstringMatcher
protected String relationship()
relationship
in class SubstringMatcher
public static Matcher<String> startsWith(String prefix)
String
starts with the specified
String
.
For example:
assertThat("myStringOfNote", startsWith("my"))
prefix
- the substring that the returned matcher will expect at the start of any examined string