aboutsummaryrefslogtreecommitdiffstats
path: root/scalding
diff options
context:
space:
mode:
authorEllen Spertus <ellen.spertus@gmail.com>2018-08-07 10:12:12 -0700
committerEllen Spertus <ellen.spertus@gmail.com>2018-08-07 10:12:12 -0700
commit6cdea0ec0950c8f12c362b6521a1bbbabc3db379 (patch)
tree032558960b9e626f72cb2b7bca26802f403328b6 /scalding
parentcbd6433af7949df7c4433468bf99eefe9973e864 (diff)
downloadsandcrawler-6cdea0ec0950c8f12c362b6521a1bbbabc3db379.tar.gz
sandcrawler-6cdea0ec0950c8f12c362b6521a1bbbabc3db379.zip
Added ScorableTest, which passes.
Diffstat (limited to 'scalding')
-rw-r--r--scalding/src/test/scala/sandcrawler/ScorableTest.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/scalding/src/test/scala/sandcrawler/ScorableTest.scala b/scalding/src/test/scala/sandcrawler/ScorableTest.scala
index 0375b6a..78cd358 100644
--- a/scalding/src/test/scala/sandcrawler/ScorableTest.scala
+++ b/scalding/src/test/scala/sandcrawler/ScorableTest.scala
@@ -8,7 +8,7 @@ import org.apache.hadoop.hbase.util.Bytes
import org.scalatest._
import parallelai.spyglass.hbase.HBaseConstants.SourceMode
-class HBaseCrossrefScoreTest extends FlatSpec with Matchers {
+class ScorableTest extends FlatSpec with Matchers {
val JsonString = """
{
"title": "<<TITLE>>",
@@ -58,24 +58,24 @@ class HBaseCrossrefScoreTest extends FlatSpec with Matchers {
"titleToSlug()" should "extract the parts of titles before a colon" in {
val slug = Scorable.titleToSlug("HELLO:there")
- slug should contain ("hello")
+ slug shouldBe "hello"
}
it should "extract an entire colon-less string" in {
val slug = Scorable.titleToSlug("hello THERE")
- slug should contain ("hello there")
+ slug shouldBe "hello there"
}
- it should "return None if given empty string" in {
- Scorable.titleToSlug("") shouldBe None
+ it should "return Scorable.NoSlug if given empty string" in {
+ Scorable.titleToSlug("") shouldBe Scorable.NoSlug
}
"jsonToMap()" should "return a map, given a legal JSON string" in {
- Scorable.jsonToMap(jsonString) should be (Some(_))
+ Scorable.jsonToMap(JsonString) should not be (None)
}
it should "return None, given illegal JSON" in {
- Scorable.jsonToMap("illegal{,json{{") should be (None))
+ Scorable.jsonToMap("illegal{,json{{") should be (None)
}
/*