diff options
author | Rocky Madden <git@rockymadden.com> | 2014-01-02 13:47:43 -0700 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2014-01-02 13:47:43 -0700 |
commit | 49de854bb464f1be37fbb27f942b9b65e52df751 (patch) | |
tree | 6c9a27ac1264648f67eba9c8707fa87d3dc5b3cd /core/src/test/scala/com/rockymadden/stringmetric/phonetic/SoundexMetricSpec.scala | |
parent | 42b990a1523a68717afcbdbc2cc4968c041451ec (diff) | |
download | stringmetric-49de854bb464f1be37fbb27f942b9b65e52df751.tar.gz stringmetric-49de854bb464f1be37fbb27f942b9b65e52df751.tar.bz2 stringmetric-49de854bb464f1be37fbb27f942b9b65e52df751.zip |
Moved from gradle to sbt.
Diffstat (limited to 'core/src/test/scala/com/rockymadden/stringmetric/phonetic/SoundexMetricSpec.scala')
-rwxr-xr-x | core/src/test/scala/com/rockymadden/stringmetric/phonetic/SoundexMetricSpec.scala | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/core/src/test/scala/com/rockymadden/stringmetric/phonetic/SoundexMetricSpec.scala b/core/src/test/scala/com/rockymadden/stringmetric/phonetic/SoundexMetricSpec.scala new file mode 100755 index 0000000..b903add --- /dev/null +++ b/core/src/test/scala/com/rockymadden/stringmetric/phonetic/SoundexMetricSpec.scala @@ -0,0 +1,35 @@ +package com.rockymadden.stringmetric.phonetic + +import com.rockymadden.stringmetric.ScalaTest +import org.junit.runner.RunWith +import org.scalatest.junit.JUnitRunner + +@RunWith(classOf[JUnitRunner]) +final class SoundexMetricSpec extends ScalaTest { "SoundexMetric" should provide { + "compare method" when passed { + "empty arguments" should returns { + "None" in { + SoundexMetric.compare("", "").isDefined should be (false) + SoundexMetric.compare("abc", "").isDefined should be (false) + SoundexMetric.compare("", "xyz").isDefined should be (false) + } + } + "non-phonetic arguments" should returns { + "None" in { + SoundexMetric.compare("123", "123").isDefined should be (false) + SoundexMetric.compare("123", "").isDefined should be (false) + SoundexMetric.compare("", "123").isDefined should be (false) + } + } + "phonetically similar arguments" should returns { + "Boolean indicating true" in { + SoundexMetric.compare("robert", "rupert").get should be (true) + } + } + "phonetically dissimilar arguments" should returns { + "Boolean indicating false" in { + SoundexMetric.compare("robert", "rubin").get should be (false) + } + } + } +}} |