diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-02-13 18:18:33 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-02-13 18:18:33 +0000 |
| commit | a431972f98d98114dc9a5a65a3fbaf68967a8161 (patch) | |
| tree | 5a4e6f29a884ca1091b5a8f4d5c5a4f1558b2233 /src/test/java/org/zwobble/mammoth/tests/MammothTests.java | |
| parent | cfff129846046a2549f8c78f6de458b9f4183f43 (diff) | |
Add result objects
Diffstat (limited to 'src/test/java/org/zwobble/mammoth/tests/MammothTests.java')
| -rw-r--r-- | src/test/java/org/zwobble/mammoth/tests/MammothTests.java | 16 |
1 files changed, 10 insertions, 6 deletions
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("<p>Walking on imported air</p>")); + deepEquals(success("<p>Walking on imported air</p>"))); } - private String convertToHtml(String name) { + private Result<String> convertToHtml(String name) { File file = TestData.file(name); return Mammoth.convertToHtml(file); } |
