diff options
author | Rocky Madden <git@rockymadden.com> | 2014-01-06 10:48:10 -0700 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2014-01-06 10:48:10 -0700 |
commit | 7b33ad53548c53ce1b8441871fc67fc67f456fdd (patch) | |
tree | 6b7efe82cc710b38ba7a4cb3637f84de92966ac4 /cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala | |
parent | ab53b6fd3023748a39b27dcc8784c3880e413833 (diff) | |
download | stringmetric-7b33ad53548c53ce1b8441871fc67fc67f456fdd.tar.gz stringmetric-7b33ad53548c53ce1b8441871fc67fc67f456fdd.tar.bz2 stringmetric-7b33ad53548c53ce1b8441871fc67fc67f456fdd.zip |
Converted subproject to specs2 from scalatest.
Diffstat (limited to 'cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala')
-rwxr-xr-x | cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala index ce9cebd..7a82f5e 100755 --- a/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala +++ b/cli/src/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.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 refinednysiismetricSpec extends org.specs2.mutable.SpecificationWithJUnit { + "refinednysiismetric main()" should { + "print if they are a match with valid dashless arguments" in { + val out = new java.io.ByteArrayOutputStream() -@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 must beEqualTo("true\n") + out.reset() - Console.withOut(out)( - refinednysiismetric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) + Console.withOut(out)(refinednysiismetric.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)( - 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() - } + Console.withOut(out)(refinednysiismetric.main(Array("--unitTest", "--debug", "1", "1"))) + out.toString must beEqualTo("not comparable\n") } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - refinednysiismetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + "throw IllegalArgumentException no dashless arguments" in { + refinednysiismetric.main(Array("--unitTest", "--debug")) must throwA[IllegalArgumentException] } } -}} +} |