From f8bce9e28851cf09e750242c7eea097f1c198691 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 13 Sep 2018 07:27:39 -0400 Subject: [PATCH] Added more unit tests --- .../tst/ripper/rippers/TsuminoRipperTest.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/TsuminoRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/TsuminoRipperTest.java index 889a43b4..7d403776 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/TsuminoRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/TsuminoRipperTest.java @@ -5,6 +5,9 @@ import java.net.URL; import java.util.List; import com.rarchives.ripme.ripper.rippers.TsuminoRipper; +import com.rarchives.ripme.utils.RipUtils; +import org.jsoup.nodes.Document; + public class TsuminoRipperTest extends RippersTest { public void testTsuminoRipper() throws IOException { @@ -14,14 +17,21 @@ public class TsuminoRipperTest extends RippersTest { public void testTagBlackList() throws IOException { TsuminoRipper ripper = new TsuminoRipper(new URL("http://www.tsumino.com/Book/Info/42882/chaldea-maid-")); + Document doc = ripper.getFirstPage(); + List tagsOnPage = ripper.getTags(doc); String[] tags1 = {"test", "one", "Blowjob"}; - String blacklistedTag = ripper.checkTags(ripper.getFirstPage(), tags1); + String blacklistedTag = RipUtils.checkTags(tags1, tagsOnPage); assertEquals("blowjob", blacklistedTag); // Test a tag with spaces String[] tags2 = {"test", "one", "Full Color"}; - blacklistedTag = ripper.checkTags(ripper.getFirstPage(), tags2); + blacklistedTag = RipUtils.checkTags(tags2, tagsOnPage); assertEquals("full color", blacklistedTag); + // Test a album with no blacklisted tags + String[] tags3 = {"nothing", "one", "null"}; + blacklistedTag = RipUtils.checkTags(tags3, tagsOnPage); + assertNull(blacklistedTag); + } } \ No newline at end of file