summaryrefslogtreecommitdiff
path: root/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala')
-rwxr-xr-xcli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala37
1 files changed, 37 insertions, 0 deletions
diff --git a/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala
new file mode 100755
index 0000000..21ae04a
--- /dev/null
+++ b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala
@@ -0,0 +1,37 @@
+package com.rockymadden.stringmetric.cli.phonetic
+
+import com.rockymadden.stringmetric.cli.ScalaTest
+import org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
+
+@RunWith(classOf[JUnitRunner])
+final class nysiisalgorithmSpec extends ScalaTest { "nysiisalgorithm" should provide {
+ "main method" when passed {
+ "valid dashless argument" should executes {
+ "print phonetic representation" in {
+ val out = new java.io.ByteArrayOutputStream()
+
+ Console.withOut(out)(
+ nysiisalgorithm.main(Array("--unitTest", "--debug", "abc"))
+ )
+
+ out.toString should equal ("abc\n")
+ out.reset()
+
+ Console.withOut(out)(
+ nysiisalgorithm.main(Array("--unitTest", "--debug", "1"))
+ )
+
+ out.toString should equal ("not computable\n")
+ out.reset()
+ }
+ }
+ "no dashless argument" should throws {
+ "IllegalArgumentException" in {
+ evaluating {
+ nysiisalgorithm.main(Array("--unitTest", "--debug"))
+ } should produce [IllegalArgumentException]
+ }
+ }
+ }
+}}