use of org.hamcrest.Description in project JsonPath by jayway.
the class IsJsonFileTest method shouldBeDescriptive.
@Test
public void shouldBeDescriptive() {
Matcher<File> matcher = isJsonFile(withPathEvaluatedTo(true));
Description description = new StringDescription();
matcher.describeTo(description);
assertThat(description.toString(), startsWith("is json"));
assertThat(description.toString(), containsString(MATCH_TRUE_TEXT));
}
use of org.hamcrest.Description in project JsonPath by jayway.
the class IsJsonStringTest method shouldDescribeMismatchOfInvalidJson.
@Test
public void shouldDescribeMismatchOfInvalidJson() {
Matcher<String> matcher = isJsonString(withPathEvaluatedTo(true));
Description description = new StringDescription();
matcher.describeMismatch("invalid-json", description);
assertThat(description.toString(), containsString("\"invalid-json\""));
}
use of org.hamcrest.Description in project JsonPath by jayway.
the class IsJsonStringTest method shouldBeDescriptive.
@Test
public void shouldBeDescriptive() {
Matcher<String> matcher = isJsonString(withPathEvaluatedTo(true));
Description description = new StringDescription();
matcher.describeTo(description);
assertThat(description.toString(), startsWith("is json"));
assertThat(description.toString(), containsString(MATCH_TRUE_TEXT));
}
use of org.hamcrest.Description in project JsonPath by jayway.
the class IsJsonTest method shouldDescribeMismatchOfValidJson.
@Test
public void shouldDescribeMismatchOfValidJson() {
Matcher<Object> matcher = isJson(withPathEvaluatedTo(true));
Description description = new StringDescription();
matcher.describeMismatch(BOOKS_JSON_STRING, description);
assertThat(description.toString(), containsString(TestingMatchers.MISMATCHED_TEXT));
}
use of org.hamcrest.Description in project JsonPath by jayway.
the class IsJsonTest method shouldBeDescriptive.
@Test
public void shouldBeDescriptive() {
Matcher<Object> matcher = isJson(withPathEvaluatedTo(true));
Description description = new StringDescription();
matcher.describeTo(description);
assertThat(description.toString(), startsWith("is json"));
assertThat(description.toString(), containsString(TestingMatchers.MATCH_TRUE_TEXT));
}
Aggregations