diff options
Diffstat (limited to 'core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiNumberFilterSpec.scala')
-rwxr-xr-x | core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiNumberFilterSpec.scala | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiNumberFilterSpec.scala b/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiNumberFilterSpec.scala new file mode 100755 index 0000000..7c24d45 --- /dev/null +++ b/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiNumberFilterSpec.scala @@ -0,0 +1,33 @@ +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 AsciiNumberFilterSpec extends ScalaTest { + import AsciiNumberFilterSpec.Filter + + "AsciiNumberFilter" should provide { + "overloaded filter method" when passed { + "String with numbers" should returns { + "String with numbers removed" in { + Filter.filter(" Hello123World!") should equal (" HelloWorld!") + Filter.filter("123 HelloWorld!") should equal (" HelloWorld!") + Filter.filter(" HelloWorld!123") should equal (" HelloWorld!") + } + } + "character array with numbers" should returns { + "character array with numbers removed" in { + Filter.filter(" Hello123World!".toCharArray) should equal (" HelloWorld!".toCharArray) + Filter.filter("123 HelloWorld!".toCharArray) should equal (" HelloWorld!".toCharArray) + Filter.filter(" HelloWorld!123".toCharArray) should equal (" HelloWorld!".toCharArray) + } + } + } + } +} + +object AsciiNumberFilterSpec { + private final val Filter = new StringFilterDelegate with AsciiNumberFilter +} |