From 4c5dbdf964da9ca29246b0f8eadec6daae1d3ffb Mon Sep 17 00:00:00 2001 From: Ellen Spertus Date: Wed, 25 Jul 2018 10:46:04 -0700 Subject: Figured out string conversion. Tests pass. Still WIP. --- .../src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scalding/src/test/scala') diff --git a/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala b/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala index f52c5b4..0d681b9 100644 --- a/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala +++ b/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala @@ -178,10 +178,14 @@ class HBaseCrossrefScoreTest extends FunSpec with TupleConversions { .source(TextLine(input), List(( "0" -> CrossrefString.replace("<>", "Title 1: TNG").replace("<<DOI>>", "DOI-0"), "1" -> CrossrefString.replace("<<TITLE>>", "Title 2: Rebooted").replace("<<DOI>>", "DOI-1")))) - .sink[Tuple](TypedTsv[(String, String, String)](output)) { + .sink[(String, String, String)](TypedTsv[(String, String, String)](output)) { outputBuffer => - it("should return a 2-element list.") { - assert(outputBuffer.size === 2) + it("should return a 4-element list.") { + assert(outputBuffer.size === 4) + } + it("should return the right slugs.") { + val (sha1, json, slug) = outputBuffer(0) + assert(slug == "title1") } } .run -- cgit v1.2.3