diff options
Diffstat (limited to 'core/source/test/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetricSpec.scala')
-rwxr-xr-x | core/source/test/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetricSpec.scala | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/core/source/test/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetricSpec.scala b/core/source/test/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetricSpec.scala index 9a029d8..94ff5db 100755 --- a/core/source/test/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetricSpec.scala +++ b/core/source/test/scala/com/rockymadden/stringmetric/phonetic/MetaphoneMetricSpec.scala @@ -6,49 +6,36 @@ import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) final class MetaphoneMetricSpec extends ScalaTest { - import MetaphoneMetricSpec.Metric - "MetaphoneMetric" should provide { "compare method" when passed { "empty arguments" should returns { "None" in { - Metric.compare("", "").isDefined should be (false) - Metric.compare("abc", "").isDefined should be (false) - Metric.compare("", "xyz").isDefined should be (false) + MetaphoneMetric.compare("", "").isDefined should be (false) + MetaphoneMetric.compare("abc", "").isDefined should be (false) + MetaphoneMetric.compare("", "xyz").isDefined should be (false) } } "non-phonetic arguments" should returns { "None" in { - Metric.compare("123", "123").isDefined should be (false) - Metric.compare("123", "").isDefined should be (false) - Metric.compare("", "123").isDefined should be (false) + MetaphoneMetric.compare("123", "123").isDefined should be (false) + MetaphoneMetric.compare("123", "").isDefined should be (false) + MetaphoneMetric.compare("", "123").isDefined should be (false) } } "phonetically similar arguments" should returns { "Boolean indicating true" in { - Metric.compare("dumb", "dum").get should be (true) - Metric.compare("smith", "smeth").get should be (true) - Metric.compare("merci", "mercy").get should be (true) + MetaphoneMetric.compare("dumb", "dum").get should be (true) + MetaphoneMetric.compare("smith", "smeth").get should be (true) + MetaphoneMetric.compare("merci", "mercy").get should be (true) } } "phonetically dissimilar arguments" should returns { "Boolean indicating false" in { - Metric.compare("dumb", "gum").get should be (false) - Metric.compare("smith", "kiss").get should be (false) - Metric.compare("merci", "burpy").get should be (false) + MetaphoneMetric.compare("dumb", "gum").get should be (false) + MetaphoneMetric.compare("smith", "kiss").get should be (false) + MetaphoneMetric.compare("merci", "burpy").get should be (false) } } } } - "MetaphoneMetric companion object" should provide { - "pass-through compare method" should returns { - "same value as class" in { - MetaphoneMetric.compare("dumb", "gum").get should be (false) - } - } - } -} - -object MetaphoneMetricSpec { - final private val Metric = MetaphoneMetric() } |