blob: 6d4873aa57fe0738829ffd5d943b22693d0821d9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
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)
}
}
}
}
}
|