-
Notifications
You must be signed in to change notification settings - Fork 630
Writing a unit test
cyian-1756 edited this page Jun 23, 2018
·
2 revisions
Create the unit test file in src/test/java/com/rarchives/ripme/tst/ripper/rippers
File should follow the naming scheme RipperTest.java
public class YoursiteRipper extends RippersTest {
public void test<Site>Rip() throws IOException {
<Site>Ripper ripper = new DribbbleRipper(new URL(<URL the ripper supports>));
testRipper(ripper);
}
You should do this for every album type that the ripper supports
Althought not required you should write a unit test for getGID and getAlbumbTitle (If your ripper supports getAlbumbTitle)
An example of both of these can be found in the zizki ripper
public void testGetGID() throws IOException {
URL url = new URL("http://zizki.com/dee-chorde/we-got-spirit");
ZizkiRipper ripper = new ZizkiRipper(url);
assertEquals("dee-chorde", ripper.getGID(url));
}
public void testAlbumTitle() throws IOException {
URL url = new URL("http://zizki.com/dee-chorde/we-got-spirit");
ZizkiRipper ripper = new ZizkiRipper(url);
assertEquals("zizki_Dee Chorde_We Got Spirit", ripper.getAlbumTitle(url));
}