diff options
Diffstat (limited to 'stringmetric-cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala')
-rwxr-xr-x | stringmetric-cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/stringmetric-cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala b/stringmetric-cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala new file mode 100755 index 0000000..4b4889d --- /dev/null +++ b/stringmetric-cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala @@ -0,0 +1,46 @@ +package com.rockymadden.stringmetric.cli.phonetic + +import com.rockymadden.stringmetric.ScalaTest +import org.junit.runner.RunWith +import org.scalatest.junit.JUnitRunner + +@RunWith(classOf[JUnitRunner]) +final class refinednysiismetricSpec extends ScalaTest { + "refinednysiismetric" should provide { + "main method" when passed { + "valid dashless arguments" should executes { + "print if they are a match" in { + val out = new java.io.ByteArrayOutputStream() + + Console.withOut(out)( + refinednysiismetric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) + + out.toString should equal ("true\n") + out.reset() + + Console.withOut(out)( + refinednysiismetric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) + + out.toString should equal ("false\n") + out.reset() + + Console.withOut(out)( + refinednysiismetric.main(Array("--unitTest", "--debug", "1", "1")) + ) + + out.toString should equal ("not comparable\n") + out.reset() + } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + refinednysiismetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] + } + } + } + } +} |