summaryrefslogtreecommitdiff
path: root/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiLetterFilterSpec.scala
blob: d86e7a51e9642c1d1b947c7ca0e06c5aed11b13e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 AsciiLetterFilterSpec extends ScalaTest {
	import AsciiLetterFilterSpec.Filter

	"AsciiLetterFilter" should provide {
		"overloaded filter method" when passed {
			"String with letters" should returns {
				"String with letters removed" in {
					Filter.filter("	Hello123World!") should equal ("	123!")
				}
			}
			"character array with letters" should returns {
				"character array with letters removed" in {
					Filter.filter("	Hello123World!".toCharArray) should equal ("	123!".toCharArray)
				}
			}
		}
	}
}

object AsciiLetterFilterSpec {
	private final val Filter = new StringFilterDelegate with AsciiLetterFilter
}