summaryrefslogtreecommitdiff
path: root/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala
blob: 7a82f5e5c2a09ae1966dc3e475561dd1042e76cc (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
package com.rockymadden.stringmetric.cli.phonetic

object refinednysiismetricSpec extends org.specs2.mutable.SpecificationWithJUnit {
	"refinednysiismetric main()" should {
		"print if they are a match with valid dashless arguments" in {
			val out = new java.io.ByteArrayOutputStream()

			Console.withOut(out)(refinednysiismetric.main(Array("--unitTest", "--debug", "abc", "abc")))
			out.toString must beEqualTo("true\n")
			out.reset()

			Console.withOut(out)(refinednysiismetric.main(Array("--unitTest", "--debug", "abc", "xyz")))
			out.toString must beEqualTo("false\n")
			out.reset()

			Console.withOut(out)(refinednysiismetric.main(Array("--unitTest", "--debug", "1", "1")))
			out.toString must beEqualTo("not comparable\n")
		}
		"throw IllegalArgumentException no dashless arguments" in {
			refinednysiismetric.main(Array("--unitTest", "--debug")) must throwA[IllegalArgumentException]
		}
	}
}