diff options
author | Ellen Spertus <ellen.spertus@gmail.com> | 2018-08-09 11:30:44 -0700 |
---|---|---|
committer | Ellen Spertus <ellen.spertus@gmail.com> | 2018-08-09 11:30:44 -0700 |
commit | 6d64c5d4e1527c7277527132efa858def2589486 (patch) | |
tree | 56b34fceae5e4e3e0c476dbc5c6fbf2673c60b04 /scalding/src/test/scala | |
parent | ccfeb71ef2a25a479c083051acc0ebb7436e421b (diff) | |
download | sandcrawler-6d64c5d4e1527c7277527132efa858def2589486.tar.gz sandcrawler-6d64c5d4e1527c7277527132efa858def2589486.zip |
Added test for null argument to titleToSlug()
Diffstat (limited to 'scalding/src/test/scala')
-rw-r--r-- | scalding/src/test/scala/sandcrawler/ScorableTest.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scalding/src/test/scala/sandcrawler/ScorableTest.scala b/scalding/src/test/scala/sandcrawler/ScorableTest.scala index 713a7e5..40801a0 100644 --- a/scalding/src/test/scala/sandcrawler/ScorableTest.scala +++ b/scalding/src/test/scala/sandcrawler/ScorableTest.scala @@ -71,6 +71,10 @@ class ScorableTest extends FlatSpec with Matchers { Scorable.titleToSlug("") shouldBe Scorable.NoSlug } + it should "return Scorable.NoSlug if given null" in { + Scorable.titleToSlug(null) shouldBe Scorable.NoSlug + } + "titleToSlug()" should "strip punctuation" in { Scorable.titleToSlug("HELLO!:the:re") shouldBe "hello" Scorable.titleToSlug("a:b:c") shouldBe "a" |