From a431972f98d98114dc9a5a65a3fbaf68967a8161 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 13 Feb 2016 18:18:33 +0000 Subject: Add result objects --- .../java/org/zwobble/mammoth/tests/MammothTests.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/test/java/org/zwobble/mammoth/tests/MammothTests.java') diff --git a/src/test/java/org/zwobble/mammoth/tests/MammothTests.java b/src/test/java/org/zwobble/mammoth/tests/MammothTests.java index 3bbc3e9..7966cee 100644 --- a/src/test/java/org/zwobble/mammoth/tests/MammothTests.java +++ b/src/test/java/org/zwobble/mammoth/tests/MammothTests.java @@ -1,27 +1,31 @@ package org.zwobble.mammoth.tests; -import java.io.File; - import org.junit.Test; import org.zwobble.mammoth.Mammoth; +import org.zwobble.mammoth.Result; + +import java.io.File; -import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; +import static org.zwobble.mammoth.Result.success; +import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals; public class MammothTests { @Test public void emptyParagraphsAreIgnoredByDefault() { - assertThat(convertToHtml("empty.docx"), is("")); + assertThat( + convertToHtml("empty.docx"), + deepEquals(success(""))); } @Test public void docxContainingOneParagraphIsConvertedToSingleParagraphElement() { assertThat( convertToHtml("single-paragraph.docx"), - is("

Walking on imported air

")); + deepEquals(success("

Walking on imported air

"))); } - private String convertToHtml(String name) { + private Result convertToHtml(String name) { File file = TestData.file(name); return Mammoth.convertToHtml(file); } -- cgit v1.2.3