blob: d064e0cd64ee89c7f6ed5f03aa3837595512e0b6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package com.rockymadden.stringmetric.cli.similarity
object jarowinklermetricSpec extends org.specs2.mutable.SpecificationWithJUnit {
"jarowinklermetric main()" should {
"print the distance with valid dashless arguments" in {
val out = new java.io.ByteArrayOutputStream()
Console.withOut(out)(jarowinklermetric.main(Array("--unitTest", "--debug", "abc", "abc")))
out.toString must beEqualTo("1.0\n")
out.reset()
Console.withOut(out)(jarowinklermetric.main(Array("--unitTest", "--debug", "abc", "xyz")))
out.toString must beEqualTo("0.0\n")
}
"throw IllegalArgumentException with no dashless arguments" in {
jarowinklermetric.main(Array("--unitTest", "--debug")) must throwA[IllegalArgumentException]
}
}
}
|