summaryrefslogtreecommitdiff
path: root/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2014-01-02 13:47:43 -0700
committerRocky Madden <git@rockymadden.com>2014-01-02 13:47:43 -0700
commit49de854bb464f1be37fbb27f942b9b65e52df751 (patch)
tree6c9a27ac1264648f67eba9c8707fa87d3dc5b3cd /cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala
parent42b990a1523a68717afcbdbc2cc4968c041451ec (diff)
downloadstringmetric-49de854bb464f1be37fbb27f942b9b65e52df751.tar.gz
stringmetric-49de854bb464f1be37fbb27f942b9b65e52df751.tar.bz2
stringmetric-49de854bb464f1be37fbb27f942b9b65e52df751.zip
Moved from gradle to sbt.
Diffstat (limited to 'cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala')
-rwxr-xr-xcli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala37
1 files changed, 37 insertions, 0 deletions
diff --git a/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala
new file mode 100755
index 0000000..8b8226d
--- /dev/null
+++ b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.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 metaphonealgorithmSpec extends ScalaTest { "metaphonealgorithm" should provide {
+ "main method" when passed {
+ "valid dashless argument" should executes {
+ "print phonetic representation" in {
+ val out = new java.io.ByteArrayOutputStream()
+
+ Console.withOut(out)(
+ metaphonealgorithm.main(Array("--unitTest", "--debug", "abc"))
+ )
+
+ out.toString should equal ("abk\n")
+ out.reset()
+
+ Console.withOut(out)(
+ metaphonealgorithm.main(Array("--unitTest", "--debug", "1"))
+ )
+
+ out.toString should equal ("not computable\n")
+ out.reset()
+ }
+ }
+ "no dashless argument" should throws {
+ "IllegalArgumentException" in {
+ evaluating {
+ metaphonealgorithm.main(Array("--unitTest", "--debug"))
+ } should produce [IllegalArgumentException]
+ }
+ }
+ }
+}}