From: David ‘Bombe’ Roden Date: Tue, 10 Feb 2015 20:24:55 +0000 (+0100) Subject: Use new comic loader, update HTML file and test X-Git-Tag: v2~206 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9f73f21f75dbe06a9f859802eeeae66ea9be1564;p=rhynodge.git Use new comic loader, update HTML file and test --- diff --git a/src/test/java/net/pterodactylus/rhynodge/filters/comics/AbstruseGooseComicFilterTest.java b/src/test/java/net/pterodactylus/rhynodge/filters/comics/AbstruseGooseComicFilterTest.java index 8ad16b0..931dd35 100644 --- a/src/test/java/net/pterodactylus/rhynodge/filters/comics/AbstruseGooseComicFilterTest.java +++ b/src/test/java/net/pterodactylus/rhynodge/filters/comics/AbstruseGooseComicFilterTest.java @@ -42,31 +42,25 @@ public class AbstruseGooseComicFilterTest { private final Document document; public AbstruseGooseComicFilterTest() throws IOException { - document = loadDocument("/comics/abstrusegoose.html", "http://abstrusegoose.com/"); - } - - private Document loadDocument(String resourceName, String baseUri) throws IOException { - InputStream inputStream = getClass().getResourceAsStream(resourceName); - Document document = Jsoup.parse(inputStream, "UTF-8", baseUri); - return document; + document = ComicLoader.loadDocument("abstruse-goose.html", "http://abstrusegoose.com/"); } @Test public void extractsComicTitleCorrectly() { Optional title = abstruseGooseComicFilter.extractTitle(document); - assertThat(title, is(of("Bizarro"))); + assertThat(title, is(of("The Sudokomic Game"))); } @Test public void extractComicImagesCorrectly() { List images = abstruseGooseComicFilter.extractImageUrls(document); - assertThat(images, contains("http://abstrusegoose.com/strips/bizero.png")); + assertThat(images, contains("http://abstrusegoose.com/strips/another_fun_game_is_comic_tac_toe.png")); } @Test public void extractImageCommentsCorrectly() { List comments = abstruseGooseComicFilter.extractImageComments(document); - assertThat(comments, contains("In the additive group of the integers, bizarro zero is... well... zero.")); + assertThat(comments, contains("This is the best I could do on short notice.")); } } diff --git a/src/test/resources/comics/abstrusegoose.html b/src/test/resources/comics/abstrusegoose.html deleted file mode 100644 index 7e06768..0000000 --- a/src/test/resources/comics/abstrusegoose.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - Abstruse Goose | Bizarro - - - - - - - - - -
- - - - - -
- - - - -
- - - -
-
-

«« First    « Previous    |   Random   |   Next »    Current »»

Bizarro


- bizero
-

«« First    « Previous    |   Random   |   Next »    Current »»

- - - - \ No newline at end of file diff --git a/src/test/resources/net/pterodactylus/rhynodge/filters/comics/abstruse-goose.html b/src/test/resources/net/pterodactylus/rhynodge/filters/comics/abstruse-goose.html new file mode 100644 index 0000000..df29b65 --- /dev/null +++ b/src/test/resources/net/pterodactylus/rhynodge/filters/comics/abstruse-goose.html @@ -0,0 +1,102 @@ + + + + + + Abstruse Goose | The Sudokomic Game + + + + + + + + + +
+ + + + + +
+ + + + +
+ + + +
+
+

«« First    « Previous    |   Random   |   Next »    Current »»

The Sudokomic Game


+ another_fun_game_is_comic_tac_toe
+

«« First    « Previous    |   Random   |   Next »    Current »»

+ + + + \ No newline at end of file