summaryrefslogtreecommitdiff
path: root/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala')
-rwxr-xr-xcli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala51
1 files changed, 15 insertions, 36 deletions
diff --git a/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala
index 041fada..e7c6d2d 100755
--- a/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala
+++ b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala
@@ -1,44 +1,23 @@
package com.rockymadden.stringmetric.cli.phonetic
-import com.rockymadden.stringmetric.cli.ScalaTest
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
+object refinedsoundexmetricSpec extends org.specs2.mutable.SpecificationWithJUnit {
+ "refinedsoundexmetric main()" should {
+ "print if they are a match with valid dashless arguments" in {
+ val out = new java.io.ByteArrayOutputStream()
-@RunWith(classOf[JUnitRunner])
-final class refinedsoundexmetricSpec extends ScalaTest { "refinedsoundexmetric" 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)(refinedsoundexmetric.main(Array("--unitTest", "--debug", "abc", "abc")))
+ out.toString must beEqualTo("true\n")
+ out.reset()
- Console.withOut(out)(
- refinedsoundexmetric.main(Array("--unitTest", "--debug", "abc", "abc"))
- )
+ Console.withOut(out)(refinedsoundexmetric.main(Array("--unitTest", "--debug", "abc", "xyz")))
+ out.toString must beEqualTo("false\n")
+ out.reset()
- out.toString should equal ("true\n")
- out.reset()
-
- Console.withOut(out)(
- refinedsoundexmetric.main(Array("--unitTest", "--debug", "abc", "xyz"))
- )
-
- out.toString should equal ("false\n")
- out.reset()
-
- Console.withOut(out)(
- refinedsoundexmetric.main(Array("--unitTest", "--debug", "1", "1"))
- )
-
- out.toString should equal ("not comparable\n")
- out.reset()
- }
+ Console.withOut(out)(refinedsoundexmetric.main(Array("--unitTest", "--debug", "1", "1")))
+ out.toString must beEqualTo("not comparable\n")
}
- "no dashless arguments" should throws {
- "IllegalArgumentException" in {
- evaluating {
- refinedsoundexmetric.main(Array("--unitTest", "--debug"))
- } should produce [IllegalArgumentException]
- }
+ "throw IllegalArgumentException with no dashless arguments" in {
+ refinedsoundexmetric.main(Array("--unitTest", "--debug")) must throwA[IllegalArgumentException]
}
}
-}}
+}