Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Make the output nicer #8

Description

@mallorydxw

The HTML should be pretty-printed before handing over to assertEquals() (and we could strip the DTD and other boilerplate HTML).

We should perhaps also directly call assertThat(), so that we can have it print "Failed asserting that two HTML fragments are equal."

Bad output:

2) CategoryWidgetTest::testGetOutput2
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><body><div class="category-widget"><div class="current-cat"><ul><li><a href="/category/meow/">Meowz</a><ul><li><a href="/category/mew/">meW</a></li><li><a href="/category/mew2/">mew2</a></li></ul></li></ul></div><div class="other-cats"><ul><li>Other contents<ul><li><a href="/category/meowth/">Meowthhhh</a></li><li><a href="/category/marth/">Marth</a></li></ul></li></ul></div></div></body></html>'
+'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><body><div class="category-widget"><div class="current-cat"><ul><li><a href="/category/cat/">Cat</a><ul><li><a href="/category/oof/">Oof</a></li><li><a href="/category/woo/">Woo</a></li></ul></li></ul></div><div class="other-cats"><ul><li>Other contents<ul><li><a href="/category/cat/">Cat</a></li><li><a href="/category/cog/">Cog</a></li></ul></li></ul></div></div></body></html>'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions