Skip to content

Commit

Permalink
Test cases for #6 and #3, disabled and marked as TODO.
Browse files Browse the repository at this point in the history
  • Loading branch information
chimbori committed Nov 23, 2018
1 parent fb9e528 commit b317285
Show file tree
Hide file tree
Showing 3 changed files with 1,853 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/com/chimbori/crux/articles/GoldenFilesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ public void testMashable() {
assertEquals("http://9.mshcdn.com/wp-content/uploads/2010/07/love.jpg", article.imageUrl);
}

@Test
public void testNews24() {
Article article = TestHelper.extractFromTestFile("https://www.news24.com/World/News/watch-indonesia-frees-bali-nine-drug-smuggler-lawrence-from-prison-20181121", "news24.html");
// TODO: assertEquals("WATCH: Indonesia frees Bali Nine drug smuggler Lawrence from prison", article.title);
// TODO: assertStartsWith("The first member of the \"Bali Nine\" heroin-trafficking gang was released from prison on Wednesday after serving 13 years, in a case that caused a huge diplomatic rift between Indonesia and Australia.", article.document.text());
}

@Test
public void testNPR() {
Article article = TestHelper.extractFromTestFile("http://www.npr.org/blogs/money/2010/10/04/130329523/how-fake-money-saved-brazil", "npr.html");
Expand Down Expand Up @@ -641,6 +648,14 @@ public void testWired() {
assertEquals("http://blog.wired.com/gadgets/files/apple-touch-icon.png", article.faviconUrl);
}

@Test
public void testWiredBitcoin() {
Article article = TestHelper.extractFromTestFile("https://www.wired.com/story/bitcoin-will-burn-planet-down-how-fast/", "wired-bitcoin.html");
assertStartsWith("Max Krause was thinking of buying some bitcoin, as one does.", article.document.text());
assertEquals("Bitcoin Will Burn the Planet Down. The Question: How Fast?", article.title);
// TODO: assertContains("/master/w_1064,c_limit/Crypto-Energy-Graph1.jpg", article.document.html());
}

@Test
public void testWiredScience() {
Article article = TestHelper.extractFromTestFile("https://www.wired.com/2017/04/dangerous-volcano-can-tricky-thing-pin/", "wired-volcano.html");
Expand Down
Loading

0 comments on commit b317285

Please sign in to comment.