summaryrefslogtreecommitdiff
path: root/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala')
-rwxr-xr-xcli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala42
1 files changed, 12 insertions, 30 deletions
diff --git a/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala
index e23b3c3..13151d3 100755
--- a/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala
+++ b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala
@@ -1,37 +1,19 @@
package com.rockymadden.stringmetric.cli.phonetic
-import com.rockymadden.stringmetric.cli.ScalaTest
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
+object soundexalgorithmSpec extends org.specs2.mutable.SpecificationWithJUnit {
+ "soundexalgorithm main()" should {
+ "print phonetic representation with valid dashless argument" in {
+ val out = new java.io.ByteArrayOutputStream()
-@RunWith(classOf[JUnitRunner])
-final class soundexalgorithmSpec extends ScalaTest { "soundexalgorithm" should provide {
- "main method" when passed {
- "valid dashless argument" should executes {
- "print phonetic representation" in {
- val out = new java.io.ByteArrayOutputStream()
+ Console.withOut(out)(soundexalgorithm.main(Array("--unitTest", "--debug", "abc")))
+ out.toString must beEqualTo("a120\n")
+ out.reset()
- Console.withOut(out)(
- soundexalgorithm.main(Array("--unitTest", "--debug", "abc"))
- )
-
- out.toString should equal ("a120\n")
- out.reset()
-
- Console.withOut(out)(
- soundexalgorithm.main(Array("--unitTest", "--debug", "1"))
- )
-
- out.toString should equal ("not computable\n")
- out.reset()
- }
+ Console.withOut(out)(soundexalgorithm.main(Array("--unitTest", "--debug", "1")))
+ out.toString must beEqualTo("not computable\n")
}
- "no dashless argument" should throws {
- "IllegalArgumentException" in {
- evaluating {
- soundexalgorithm.main(Array("--unitTest", "--debug"))
- } should produce [IllegalArgumentException]
- }
+ "throw IllegalArgumentException no dashless argument" in {
+ soundexalgorithm.main(Array("--unitTest", "--debug")) must throwA[IllegalArgumentException]
}
}
-}}
+}