diff options
Diffstat (limited to 'core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSymbolFilterSpec.scala')
-rwxr-xr-x | core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSymbolFilterSpec.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSymbolFilterSpec.scala b/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSymbolFilterSpec.scala new file mode 100755 index 0000000..99be533 --- /dev/null +++ b/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSymbolFilterSpec.scala @@ -0,0 +1,31 @@ +package com.rockymadden.stringmetric.filter + +import com.rockymadden.stringmetric.ScalaTest +import org.junit.runner.RunWith +import org.scalatest.junit.JUnitRunner + +@RunWith(classOf[JUnitRunner]) +final class AsciiSymbolFilterSpec extends ScalaTest { + import AsciiSymbolFilterSpec.Filter + + "AsciiSymbolFilter" should provide { + "overloaded filter method" when passed { + "String with symbols" should returns { + "String with symbols removed" in { + Filter.filter("[HelloWorld]") should equal ("HelloWorld") + Filter.filter("Hello!World") should equal ("HelloWorld") + } + } + "character array with symbols" should returns { + "character array with symbols removed" in { + Filter.filter("[HelloWorld]".toCharArray) should equal ("HelloWorld".toCharArray) + Filter.filter("Hello!World".toCharArray) should equal ("HelloWorld".toCharArray) + } + } + } + } +} + +object AsciiSymbolFilterSpec { + private final val Filter = new StringFilterDelegate with AsciiSymbolFilter +} |