public class IsEqualCompressingWhiteSpace extends TypeSafeMatcher<String>
| Constructor and Description |
|---|
IsEqualCompressingWhiteSpace(String string) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeMismatchSafely(String item,
Description mismatchDescription)
Subclasses should override this.
|
void |
describeTo(Description description)
Generates a description of the object.
|
static Matcher<String> |
equalToCompressingWhiteSpace(String expectedString)
Creates a matcher of
String that matches when the examined string is equal to
the specified expectedString, when whitespace differences are (mostly) ignored. |
static Matcher<String> |
equalToIgnoringWhiteSpace(String expectedString)
Deprecated.
|
boolean |
matchesSafely(String item)
Subclasses should implement this.
|
String |
stripSpaces(String toBeStripped) |
describeMismatch, matches_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toStringpublic IsEqualCompressingWhiteSpace(String string)
public boolean matchesSafely(String item)
TypeSafeMatchermatchesSafely in class TypeSafeMatcher<String>public void describeMismatchSafely(String item, Description mismatchDescription)
TypeSafeMatcherdescribeMismatchSafely in class TypeSafeMatcher<String>public void describeTo(Description description)
SelfDescribingdescription - The description to be built or appended to.public static Matcher<String> equalToIgnoringWhiteSpace(String expectedString)
equalToCompressingWhiteSpace(String)expectedString - the expected value of matched stringspublic static Matcher<String> equalToCompressingWhiteSpace(String expectedString)
String that matches when the examined string is equal to
the specified expectedString, when whitespace differences are (mostly) ignored. To be
exact, the following whitespace rules are applied:
assertThat(" my\tfoo bar ", equalToCompressingWhiteSpace(" my foo bar"))expectedString - the expected value of matched stringsCopyright © 2021. All rights reserved.