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/similarity/hammingmetricSpec.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/similarity/hammingmetricSpec.scala')
-rwxr-xr-x | cli/src/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/cli/src/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala b/cli/src/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala index dc34e8f..736e46b 100755 --- a/cli/src/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala +++ b/cli/src/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala @@ -1,37 +1,19 @@ package com.rockymadden.stringmetric.cli.similarity -import com.rockymadden.stringmetric.cli.ScalaTest -import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner +object hammingmetricSpec extends org.specs2.mutable.SpecificationWithJUnit { + "hammingmetric main()" should { + "print if they are a match with valid dashless arguments" in { + val out = new java.io.ByteArrayOutputStream() -@RunWith(classOf[JUnitRunner]) -final class hammingmetricSpec extends ScalaTest { "hammingmetric" 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)(hammingmetric.main(Array("--unitTest", "--debug", "abc", "abc"))) + out.toString must beEqualTo("0\n") + out.reset() - Console.withOut(out)( - hammingmetric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) - - out.toString should equal ("0\n") - out.reset() - - Console.withOut(out)( - hammingmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) - - out.toString should equal ("3\n") - out.reset() - } + Console.withOut(out)(hammingmetric.main(Array("--unitTest", "--debug", "abc", "xyz"))) + out.toString must beEqualTo("3\n") } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - hammingmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + "throw IllegalArgumentException no dashless arguments" in { + hammingmetric.main(Array("--unitTest", "--debug")) must throwA[IllegalArgumentException] } } -}} +} |