diff options
Diffstat (limited to 'cli')
22 files changed, 684 insertions, 728 deletions
diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/OptionMapSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/OptionMapSpec.scala index 121e2ed..8ecab11 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/OptionMapSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/OptionMapSpec.scala @@ -5,80 +5,78 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class OptionMapSpec extends ScalaTest { - "OptionMap" should provide { - "apply method" when passed { - "single valid double dashed option" should returns { - "populated Map" in { - val opts: OptionMap = Array("--help") +final class OptionMapSpec extends ScalaTest { "OptionMap" should provide { + "apply method" when passed { + "single valid double dashed option" should returns { + "populated Map" in { + val opts: OptionMap = Array("--help") - (opts('help): String) should equal ("") - } + (opts('help): String) should equal ("") } - "multiple valid double dashed opts" should returns { - "populated Map" in { - val opts: OptionMap = Array("--help", "--test=test") + } + "multiple valid double dashed opts" should returns { + "populated Map" in { + val opts: OptionMap = Array("--help", "--test=test") - (opts('help): String) should equal ("") - (opts('test): String) should equal ("test") - } + (opts('help): String) should equal ("") + (opts('test): String) should equal ("test") } - "invalid double dashed opts" should returns { - "empty Map" in { - val opts: OptionMap = Array("--help#", "--test%=test") + } + "invalid double dashed opts" should returns { + "empty Map" in { + val opts: OptionMap = Array("--help#", "--test%=test") - opts.keysIterator.length should be (0) - } + opts.keysIterator.length should be (0) } - "single valid single dashed option" should returns { - "populated Map" in { - val opts: OptionMap = Array("-h") + } + "single valid single dashed option" should returns { + "populated Map" in { + val opts: OptionMap = Array("-h") - (opts('h): String) should equal ("") - } + (opts('h): String) should equal ("") } - "multiple valid single dashed opts" should returns { - "populated Map" in { - val opts: OptionMap = Array("-h", "-i") + } + "multiple valid single dashed opts" should returns { + "populated Map" in { + val opts: OptionMap = Array("-h", "-i") - (opts('h): String) should equal ("") - (opts('i): String) should equal ("") - } + (opts('h): String) should equal ("") + (opts('i): String) should equal ("") } - "invalid single dashed opts" should returns { - "empty Map" in { - val opts: OptionMap = Array("-h-i", "-i#gloo") + } + "invalid single dashed opts" should returns { + "empty Map" in { + val opts: OptionMap = Array("-h-i", "-i#gloo") - opts.keysIterator.length should be (0) - } + opts.keysIterator.length should be (0) } - "single nameless option" should returns { - "single key populated Map" in { - val opts: OptionMap = Array("filename0") + } + "single nameless option" should returns { + "single key populated Map" in { + val opts: OptionMap = Array("filename0") - (opts('dashless): String).count(_ == ' ') should be (0) - } + (opts('dashless): String).count(_ == ' ') should be (0) } - "multiple single nameless opts" should returns { - "single key populated Map" in { - val opts: OptionMap = Array("filename0", "filename1", "filename2") + } + "multiple single nameless opts" should returns { + "single key populated Map" in { + val opts: OptionMap = Array("filename0", "filename1", "filename2") - (opts('dashless): String).count(_ == ' ') should be (2) - } + (opts('dashless): String).count(_ == ' ') should be (2) } - "mixed opts" should returns { - "populated Map" in { - val opts: OptionMap = Array( - "-q", "--help", "--test=test", "-go", "filename0", "filename1", "filename2" - ) + } + "mixed opts" should returns { + "populated Map" in { + val opts: OptionMap = Array( + "-q", "--help", "--test=test", "-go", "filename0", "filename1", "filename2" + ) - (opts('q): String) should equal ("") - (opts('help): String) should equal ("") - (opts('test): String) should equal ("test") - (opts('go): String) should equal ("") - (opts('dashless): String).count(_ == ' ') should be (2) - } + (opts('q): String) should equal ("") + (opts('help): String) should equal ("") + (opts('test): String) should equal ("test") + (opts('go): String) should equal ("") + (opts('dashless): String).count(_ == ' ') should be (2) } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala index 68bdcf7..403c50e 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonealgorithmSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class metaphonealgorithmSpec extends ScalaTest { - "metaphonealgorithm" should provide { - "main method" when passed { - "valid dashless argument" should executes { - "print phonetic representation" in { - val out = new java.io.ByteArrayOutputStream() +final class metaphonealgorithmSpec extends ScalaTest { "metaphonealgorithm" should provide { + "main method" when passed { + "valid dashless argument" should executes { + "print phonetic representation" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - metaphonealgorithm.main(Array("--unitTest", "--debug", "abc")) - ) + Console.withOut(out)( + metaphonealgorithm.main(Array("--unitTest", "--debug", "abc")) + ) - out.toString should equal ("abk\n") - out.reset() + out.toString should equal ("abk\n") + out.reset() - Console.withOut(out)( - metaphonealgorithm.main(Array("--unitTest", "--debug", "1")) - ) + Console.withOut(out)( + metaphonealgorithm.main(Array("--unitTest", "--debug", "1")) + ) - out.toString should equal ("not computable\n") - out.reset() - } + out.toString should equal ("not computable\n") + out.reset() } - "no dashless argument" should throws { - "IllegalArgumentException" in { - evaluating { - metaphonealgorithm.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless argument" should throws { + "IllegalArgumentException" in { + evaluating { + metaphonealgorithm.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonemetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonemetricSpec.scala index 4e6567e..11c84ca 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonemetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/metaphonemetricSpec.scala @@ -5,42 +5,40 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class metaphonemetricSpec extends ScalaTest { - "metaphonemetric" 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)( - metaphonemetric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) - - out.toString should equal ("true\n") - out.reset() - - Console.withOut(out)( - metaphonemetric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) - - out.toString should equal ("false\n") - out.reset() - - Console.withOut(out)( - metaphonemetric.main(Array("--unitTest", "--debug", "1", "1")) - ) - - out.toString should equal ("not comparable\n") - out.reset() - } +final class metaphonemetricSpec extends ScalaTest { "metaphonemetric" 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)( + metaphonemetric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) + + out.toString should equal ("true\n") + out.reset() + + Console.withOut(out)( + metaphonemetric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) + + out.toString should equal ("false\n") + out.reset() + + Console.withOut(out)( + metaphonemetric.main(Array("--unitTest", "--debug", "1", "1")) + ) + + out.toString should equal ("not comparable\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - metaphonemetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + metaphonemetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala index 3683d2d..707deb4 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisalgorithmSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class nysiisalgorithmSpec extends ScalaTest { - "nysiisalgorithm" should provide { - "main method" when passed { - "valid dashless argument" should executes { - "print phonetic representation" in { - val out = new java.io.ByteArrayOutputStream() +final class nysiisalgorithmSpec extends ScalaTest { "nysiisalgorithm" should provide { + "main method" when passed { + "valid dashless argument" should executes { + "print phonetic representation" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - nysiisalgorithm.main(Array("--unitTest", "--debug", "abc")) - ) + Console.withOut(out)( + nysiisalgorithm.main(Array("--unitTest", "--debug", "abc")) + ) - out.toString should equal ("abc\n") - out.reset() + out.toString should equal ("abc\n") + out.reset() - Console.withOut(out)( - nysiisalgorithm.main(Array("--unitTest", "--debug", "1")) - ) + Console.withOut(out)( + nysiisalgorithm.main(Array("--unitTest", "--debug", "1")) + ) - out.toString should equal ("not computable\n") - out.reset() - } + out.toString should equal ("not computable\n") + out.reset() } - "no dashless argument" should throws { - "IllegalArgumentException" in { - evaluating { - nysiisalgorithm.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless argument" should throws { + "IllegalArgumentException" in { + evaluating { + nysiisalgorithm.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiismetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiismetricSpec.scala index 6898025..357bf6e 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiismetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/nysiismetricSpec.scala @@ -5,42 +5,40 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class nysiismetricSpec extends ScalaTest { - "nysiismetric" 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)( - nysiismetric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) - - out.toString should equal ("true\n") - out.reset() - - Console.withOut(out)( - nysiismetric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) - - out.toString should equal ("false\n") - out.reset() - - Console.withOut(out)( - nysiismetric.main(Array("--unitTest", "--debug", "1", "1")) - ) - - out.toString should equal ("not comparable\n") - out.reset() - } +final class nysiismetricSpec extends ScalaTest { "nysiismetric" 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)( + nysiismetric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) + + out.toString should equal ("true\n") + out.reset() + + Console.withOut(out)( + nysiismetric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) + + out.toString should equal ("false\n") + out.reset() + + Console.withOut(out)( + nysiismetric.main(Array("--unitTest", "--debug", "1", "1")) + ) + + out.toString should equal ("not comparable\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - nysiismetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + nysiismetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiisalgorithmSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiisalgorithmSpec.scala index f5376fa..d126b91 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiisalgorithmSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiisalgorithmSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class refinednysiisalgorithmSpec extends ScalaTest { - "refinednysiisalgorithm" should provide { - "main method" when passed { - "valid dashless argument" should executes { - "print phonetic representation" in { - val out = new java.io.ByteArrayOutputStream() +final class refinednysiisalgorithmSpec extends ScalaTest { "refinednysiisalgorithm" should provide { + "main method" when passed { + "valid dashless argument" should executes { + "print phonetic representation" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - refinednysiisalgorithm.main(Array("--unitTest", "--debug", "abc")) - ) + Console.withOut(out)( + refinednysiisalgorithm.main(Array("--unitTest", "--debug", "abc")) + ) - out.toString should equal ("abc\n") - out.reset() + out.toString should equal ("abc\n") + out.reset() - Console.withOut(out)( - refinednysiisalgorithm.main(Array("--unitTest", "--debug", "1")) - ) + Console.withOut(out)( + refinednysiisalgorithm.main(Array("--unitTest", "--debug", "1")) + ) - out.toString should equal ("not computable\n") - out.reset() - } + out.toString should equal ("not computable\n") + out.reset() } - "no dashless argument" should throws { - "IllegalArgumentException" in { - evaluating { - refinednysiisalgorithm.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless argument" should throws { + "IllegalArgumentException" in { + evaluating { + refinednysiisalgorithm.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala index 4b4889d..7f2f1b3 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinednysiismetricSpec.scala @@ -5,42 +5,40 @@ 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() - } +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] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + refinednysiismetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexalgorithmSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexalgorithmSpec.scala index 80a8fd2..503f439 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexalgorithmSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexalgorithmSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class refinedsoundexalgorithmSpec extends ScalaTest { - "refinedsoundexalgorithm" should provide { - "main method" when passed { - "valid dashless argument" should executes { - "print phonetic representation" in { - val out = new java.io.ByteArrayOutputStream() +final class refinedsoundexalgorithmSpec extends ScalaTest { "refinedsoundexalgorithm" should provide { + "main method" when passed { + "valid dashless argument" should executes { + "print phonetic representation" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - refinedsoundexalgorithm.main(Array("--unitTest", "--debug", "abc")) - ) + Console.withOut(out)( + refinedsoundexalgorithm.main(Array("--unitTest", "--debug", "abc")) + ) - out.toString should equal ("a013\n") - out.reset() + out.toString should equal ("a013\n") + out.reset() - Console.withOut(out)( - refinedsoundexalgorithm.main(Array("--unitTest", "--debug", "1")) - ) + Console.withOut(out)( + refinedsoundexalgorithm.main(Array("--unitTest", "--debug", "1")) + ) - out.toString should equal ("not computable\n") - out.reset() - } + out.toString should equal ("not computable\n") + out.reset() } - "no dashless argument" should throws { - "IllegalArgumentException" in { - evaluating { - refinedsoundexalgorithm.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless argument" should throws { + "IllegalArgumentException" in { + evaluating { + refinedsoundexalgorithm.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala index 42338af..a10f1ed 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/refinedsoundexmetricSpec.scala @@ -5,42 +5,40 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @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 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() - } +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 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() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - refinedsoundexmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + refinedsoundexmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala index f971d66..4319226 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexalgorithmSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @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() +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")) - ) + Console.withOut(out)( + soundexalgorithm.main(Array("--unitTest", "--debug", "abc")) + ) - out.toString should equal ("a120\n") - out.reset() + out.toString should equal ("a120\n") + out.reset() - Console.withOut(out)( - soundexalgorithm.main(Array("--unitTest", "--debug", "1")) - ) + Console.withOut(out)( + soundexalgorithm.main(Array("--unitTest", "--debug", "1")) + ) - out.toString should equal ("not computable\n") - out.reset() - } + out.toString should equal ("not computable\n") + out.reset() } - "no dashless argument" should throws { - "IllegalArgumentException" in { - evaluating { - soundexalgorithm.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless argument" should throws { + "IllegalArgumentException" in { + evaluating { + soundexalgorithm.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexmetricSpec.scala index 82a3f6d..c0582fa 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/phonetic/soundexmetricSpec.scala @@ -5,42 +5,40 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class soundexmetricSpec extends ScalaTest { - "soundexmetric" 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)( - soundexmetric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) - - out.toString should equal ("true\n") - out.reset() - - Console.withOut(out)( - soundexmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) - - out.toString should equal ("false\n") - out.reset() - - Console.withOut(out)( - soundexmetric.main(Array("--unitTest", "--debug", "1", "1")) - ) - - out.toString should equal ("not comparable\n") - out.reset() - } +final class soundexmetricSpec extends ScalaTest { "soundexmetric" 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)( + soundexmetric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) + + out.toString should equal ("true\n") + out.reset() + + Console.withOut(out)( + soundexmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) + + out.toString should equal ("false\n") + out.reset() + + Console.withOut(out)( + soundexmetric.main(Array("--unitTest", "--debug", "1", "1")) + ) + + out.toString should equal ("not comparable\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - soundexmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + soundexmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/dicesorensenmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/dicesorensenmetricSpec.scala index db68b68..96e6082 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/dicesorensenmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/dicesorensenmetricSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class dicesorensenmetricSpec extends ScalaTest { - "dicesorensenmetric" should provide { - "main method" when passed { - "valid dashless arguments" should executes { - "print if they are a match" in { - val out = new java.io.ByteArrayOutputStream() +final class dicesorensenmetricSpec extends ScalaTest { "dicesorensenmetric" 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)( - dicesorensenmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "abc")) - ) + Console.withOut(out)( + dicesorensenmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "abc")) + ) - out.toString should equal ("1.0\n") - out.reset() + out.toString should equal ("1.0\n") + out.reset() - Console.withOut(out)( - dicesorensenmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "xyz")) - ) + Console.withOut(out)( + dicesorensenmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "xyz")) + ) - out.toString should equal ("0.0\n") - out.reset() - } + out.toString should equal ("0.0\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - dicesorensenmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + dicesorensenmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala index 28e91ad..d3304b6 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/hammingmetricSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @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() +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")) - ) + Console.withOut(out)( + hammingmetric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) - out.toString should equal ("0\n") - out.reset() + out.toString should equal ("0\n") + out.reset() - Console.withOut(out)( - hammingmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) + Console.withOut(out)( + hammingmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) - out.toString should equal ("3\n") - out.reset() - } + out.toString should equal ("3\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - hammingmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + hammingmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jaccardmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jaccardmetricSpec.scala index 9f7e2b9..e684ae2 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jaccardmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jaccardmetricSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class jaccardmetricSpec extends ScalaTest { - "jaccardmetric" should provide { - "main method" when passed { - "valid dashless arguments" should executes { - "print if they are a match" in { - val out = new java.io.ByteArrayOutputStream() +final class jaccardmetricSpec extends ScalaTest { "jaccardmetric" 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)( - jaccardmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "abc")) - ) + Console.withOut(out)( + jaccardmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "abc")) + ) - out.toString should equal ("1.0\n") - out.reset() + out.toString should equal ("1.0\n") + out.reset() - Console.withOut(out)( - jaccardmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "xyz")) - ) + Console.withOut(out)( + jaccardmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "xyz")) + ) - out.toString should equal ("0.0\n") - out.reset() - } + out.toString should equal ("0.0\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - jaccardmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + jaccardmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jarometricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jarometricSpec.scala index 980ecff..bc07e30 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jarometricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jarometricSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class jarometricSpec extends ScalaTest { - "jarometric" should provide { - "main method" when passed { - "valid dashless arguments" should executes { - "print the distance" in { - val out = new java.io.ByteArrayOutputStream() +final class jarometricSpec extends ScalaTest { "jarometric" should provide { + "main method" when passed { + "valid dashless arguments" should executes { + "print the distance" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - jarometric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) + Console.withOut(out)( + jarometric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) - out.toString should equal ("1.0\n") - out.reset() + out.toString should equal ("1.0\n") + out.reset() - Console.withOut(out)( - jarometric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) + Console.withOut(out)( + jarometric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) - out.toString should equal ("0.0\n") - out.reset() - } + out.toString should equal ("0.0\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - jarometric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + jarometric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jarowinklermetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jarowinklermetricSpec.scala index d84f1a5..46ae0c6 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jarowinklermetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/jarowinklermetricSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class jarowinklermetricSpec extends ScalaTest { - "jarowinklermetric" should provide { - "main method" when passed { - "valid dashless arguments" should executes { - "print the distance" in { - val out = new java.io.ByteArrayOutputStream() +final class jarowinklermetricSpec extends ScalaTest { "jarowinklermetric" should provide { + "main method" when passed { + "valid dashless arguments" should executes { + "print the distance" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - jarowinklermetric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) + Console.withOut(out)( + jarowinklermetric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) - out.toString should equal ("1.0\n") - out.reset() + out.toString should equal ("1.0\n") + out.reset() - Console.withOut(out)( - jarowinklermetric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) + Console.withOut(out)( + jarowinklermetric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) - out.toString should equal ("0.0\n") - out.reset() - } + out.toString should equal ("0.0\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - jarowinklermetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + jarowinklermetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/levenshteinmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/levenshteinmetricSpec.scala index ec4c8a7..7c89405 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/levenshteinmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/levenshteinmetricSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class levenshteinmetricSpec extends ScalaTest { - "levenshteinmetric" should provide { - "main method" when passed { - "valid dashless arguments" should executes { - "print if they are a match" in { - val out = new java.io.ByteArrayOutputStream() +final class levenshteinmetricSpec extends ScalaTest { "levenshteinmetric" 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)( - levenshteinmetric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) + Console.withOut(out)( + levenshteinmetric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) - out.toString should equal ("0\n") - out.reset() + out.toString should equal ("0\n") + out.reset() - Console.withOut(out)( - levenshteinmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) + Console.withOut(out)( + levenshteinmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) - out.toString should equal ("3\n") - out.reset() - } + out.toString should equal ("3\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - levenshteinmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + levenshteinmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/ngrammetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/ngrammetricSpec.scala index f969df3..3a4277b 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/ngrammetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/ngrammetricSpec.scala @@ -5,64 +5,62 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class ngrammetricSpec extends ScalaTest { - "ngrammetric" should provide { - "main method" when passed { - "valid dashless arguments and valid n argument" should executes { - "print if they are a match" in { - val out = new java.io.ByteArrayOutputStream() +final class ngrammetricSpec extends ScalaTest { "ngrammetric" should provide { + "main method" when passed { + "valid dashless arguments and valid n argument" should executes { + "print if they are a match" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - ngrammetric.main( - Array( - "--unitTest", - "--debug", - "--n=1", - "abc", - "abc" - ) + Console.withOut(out)( + ngrammetric.main( + Array( + "--unitTest", + "--debug", + "--n=1", + "abc", + "abc" ) ) + ) - out.toString should equal ("1.0\n") - out.reset() + out.toString should equal ("1.0\n") + out.reset() - Console.withOut(out)( - ngrammetric.main( - Array( - "--unitTest", - "--debug", - "--n=1", - "abc", - "xyz" - ) + Console.withOut(out)( + ngrammetric.main( + Array( + "--unitTest", + "--debug", + "--n=1", + "abc", + "xyz" ) ) + ) - out.toString should equal ("0.0\n") - out.reset() - } + out.toString should equal ("0.0\n") + out.reset() } - "valid dashless arguments and invalid n argument" should throws { - "IllegalArgumentException" in { - evaluating { - ngrammetric.main( - Array( - "--unitTest", - "abc", - "abc" - ) + } + "valid dashless arguments and invalid n argument" should throws { + "IllegalArgumentException" in { + evaluating { + ngrammetric.main( + Array( + "--unitTest", + "abc", + "abc" ) - } should produce [IllegalArgumentException] - } + ) + } should produce [IllegalArgumentException] } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - ngrammetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + ngrammetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/overlapmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/overlapmetricSpec.scala index d614a77..6e15228 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/overlapmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/overlapmetricSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class overlapmetricSpec extends ScalaTest { - "overlapmetric" should provide { - "main method" when passed { - "valid dashless arguments" should executes { - "print if they are a match" in { - val out = new java.io.ByteArrayOutputStream() +final class overlapmetricSpec extends ScalaTest { "overlapmetric" 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)( - overlapmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "abc")) - ) + Console.withOut(out)( + overlapmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "abc")) + ) - out.toString should equal ("1.0\n") - out.reset() + out.toString should equal ("1.0\n") + out.reset() - Console.withOut(out)( - overlapmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "xyz")) - ) + Console.withOut(out)( + overlapmetric.main(Array("--unitTest", "--debug", "--n=2", "abc", "xyz")) + ) - out.toString should equal ("0.0\n") - out.reset() - } + out.toString should equal ("0.0\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - overlapmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + overlapmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/ratcliffobershelpmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/ratcliffobershelpmetricSpec.scala index 8af7793..e1d2bef 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/ratcliffobershelpmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/ratcliffobershelpmetricSpec.scala @@ -5,35 +5,33 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class ratcliffobershelpmetricSpec extends ScalaTest { - "ratcliffobershelpmetric" should provide { - "main method" when passed { - "valid dashless arguments" should executes { - "print if they are a match" in { - val out = new java.io.ByteArrayOutputStream() +final class ratcliffobershelpmetricSpec extends ScalaTest { "ratcliffobershelpmetric" 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)( - ratcliffobershelpmetric.main(Array("--unitTest", "--debug", "abc", "abc")) - ) + Console.withOut(out)( + ratcliffobershelpmetric.main(Array("--unitTest", "--debug", "abc", "abc")) + ) - out.toString should equal ("1.0\n") - out.reset() + out.toString should equal ("1.0\n") + out.reset() - Console.withOut(out)( - ratcliffobershelpmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) - ) + Console.withOut(out)( + ratcliffobershelpmetric.main(Array("--unitTest", "--debug", "abc", "xyz")) + ) - out.toString should equal ("0.0\n") - out.reset() - } + out.toString should equal ("0.0\n") + out.reset() } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - ratcliffobershelpmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + ratcliffobershelpmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/weightedlevenshteinmetricSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/weightedlevenshteinmetricSpec.scala index 41065db..f0ac8be 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/weightedlevenshteinmetricSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/similarity/weightedlevenshteinmetricSpec.scala @@ -5,119 +5,117 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class weightedlevenshteinmetricSpec extends ScalaTest { - "weightedlevenshteinmetric" should provide { - "main method" when passed { - "valid dashless arguments and valid weight arguments" should executes { - "print if they are a match" in { - val out = new java.io.ByteArrayOutputStream() +final class weightedlevenshteinmetricSpec extends ScalaTest { "weightedlevenshteinmetric" should provide { + "main method" when passed { + "valid dashless arguments and valid weight arguments" should executes { + "print if they are a match" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - weightedlevenshteinmetric.main( - Array( - "--unitTest", - "--debug", - "--deleteWeight=1", - "--insertWeight=1", - "--substituteWeight=1", - "abc", - "abc" - ) + Console.withOut(out)( + weightedlevenshteinmetric.main( + Array( + "--unitTest", + "--debug", + "--deleteWeight=1", + "--insertWeight=1", + "--substituteWeight=1", + "abc", + "abc" ) ) + ) - out.toString should equal ("0.0\n") - out.reset() + out.toString should equal ("0.0\n") + out.reset() - Console.withOut(out)( - weightedlevenshteinmetric.main( - Array( - "--unitTest", - "--debug", - "--deleteWeight=2", - "--insertWeight=2", - "--substituteWeight=1", - "abc", - "xyz" - ) + Console.withOut(out)( + weightedlevenshteinmetric.main( + Array( + "--unitTest", + "--debug", + "--deleteWeight=2", + "--insertWeight=2", + "--substituteWeight=1", + "abc", + "xyz" ) ) + ) - out.toString should equal ("3.0\n") - out.reset() + out.toString should equal ("3.0\n") + out.reset() - Console.withOut(out)( - weightedlevenshteinmetric.main( - Array( - "--unitTest", - "--debug", - "--deleteWeight=2", - "--insertWeight=1", - "--substituteWeight=2", - "xyz", - "xyzxyz" - ) + Console.withOut(out)( + weightedlevenshteinmetric.main( + Array( + "--unitTest", + "--debug", + "--deleteWeight=2", + "--insertWeight=1", + "--substituteWeight=2", + "xyz", + "xyzxyz" ) ) + ) - out.toString should equal ("3.0\n") - out.reset() + out.toString should equal ("3.0\n") + out.reset() - Console.withOut(out)( - weightedlevenshteinmetric.main( - Array( - "--unitTest", - "--debug", - "--deleteWeight=1", - "--insertWeight=2", - "--substituteWeight=2", - "xyzxyz", - "xyz" - ) + Console.withOut(out)( + weightedlevenshteinmetric.main( + Array( + "--unitTest", + "--debug", + "--deleteWeight=1", + "--insertWeight=2", + "--substituteWeight=2", + "xyzxyz", + "xyz" ) ) + ) - out.toString should equal ("3.0\n") - out.reset() - } + out.toString should equal ("3.0\n") + out.reset() } - "valid dashless arguments and invalid weight arguments" should throws { - "IllegalArgumentException" in { - evaluating { - weightedlevenshteinmetric.main( - Array( - "--unitTest", - "--debug", - "--deleteWeight=1", - "--substituteWeight=1", - "abc", - "abc" - ) + } + "valid dashless arguments and invalid weight arguments" should throws { + "IllegalArgumentException" in { + evaluating { + weightedlevenshteinmetric.main( + Array( + "--unitTest", + "--debug", + "--deleteWeight=1", + "--substituteWeight=1", + "abc", + "abc" ) - } should produce [IllegalArgumentException] + ) + } should produce [IllegalArgumentException] - evaluating { - weightedlevenshteinmetric.main( - Array( - "--unitTest", - "--debug", - "--deleteWeight=1", - "--insertWeight=q", - "--substituteWeight=1", - "abc", - "abc" - ) + evaluating { + weightedlevenshteinmetric.main( + Array( + "--unitTest", + "--debug", + "--deleteWeight=1", + "--insertWeight=q", + "--substituteWeight=1", + "abc", + "abc" ) - } should produce [IllegalArgumentException] - } + ) + } should produce [IllegalArgumentException] } - "no dashless arguments" should throws { - "IllegalArgumentException" in { - evaluating { - weightedlevenshteinmetric.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless arguments" should throws { + "IllegalArgumentException" in { + evaluating { + weightedlevenshteinmetric.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} diff --git a/cli/source/test/scala/com/rockymadden/stringmetric/cli/tokenize/ngramtokenizerSpec.scala b/cli/source/test/scala/com/rockymadden/stringmetric/cli/tokenize/ngramtokenizerSpec.scala index 5fea2e9..552fcf4 100755 --- a/cli/source/test/scala/com/rockymadden/stringmetric/cli/tokenize/ngramtokenizerSpec.scala +++ b/cli/source/test/scala/com/rockymadden/stringmetric/cli/tokenize/ngramtokenizerSpec.scala @@ -5,62 +5,60 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class ngramtokenizerSpec extends ScalaTest { - "ngramtokenizer" should provide { - "main method" when passed { - "valid dashless argument and valid n argument" should executes { - "print N-Gram representation" in { - val out = new java.io.ByteArrayOutputStream() +final class ngramtokenizerSpec extends ScalaTest { "ngramtokenizer" should provide { + "main method" when passed { + "valid dashless argument and valid n argument" should executes { + "print N-Gram representation" in { + val out = new java.io.ByteArrayOutputStream() - Console.withOut(out)( - ngramtokenizer.main( - Array( - "--unitTest", - "--debug", - "--n=1", - "abc" - ) + Console.withOut(out)( + ngramtokenizer.main( + Array( + "--unitTest", + "--debug", + "--n=1", + "abc" ) ) + ) - out.toString should equal ("a|b|c\n") - out.reset() + out.toString should equal ("a|b|c\n") + out.reset() - Console.withOut(out)( - ngramtokenizer.main( - Array( - "--unitTest", - "--debug", - "--n=2", - "abc" - ) + Console.withOut(out)( + ngramtokenizer.main( + Array( + "--unitTest", + "--debug", + "--n=2", + "abc" ) ) + ) - out.toString should equal ("ab|bc\n") - out.reset() - } + out.toString should equal ("ab|bc\n") + out.reset() } - "valid dashless argument and invalid n argument" should throws { - "IllegalArgumentException" in { - evaluating { - ngramtokenizer.main( - Array( - "--unitTest", - "abc", - "abc" - ) + } + "valid dashless argument and invalid n argument" should throws { + "IllegalArgumentException" in { + evaluating { + ngramtokenizer.main( + Array( + "--unitTest", + "abc", + "abc" ) - } should produce [IllegalArgumentException] - } + ) + } should produce [IllegalArgumentException] } - "no dashless argument" should throws { - "IllegalArgumentException" in { - evaluating { - ngramtokenizer.main(Array("--unitTest", "--debug")) - } should produce [IllegalArgumentException] - } + } + "no dashless argument" should throws { + "IllegalArgumentException" in { + evaluating { + ngramtokenizer.main(Array("--unitTest", "--debug")) + } should produce [IllegalArgumentException] } } } -} +}} |