summaryrefslogtreecommitdiff
path: root/core/source/test/scala/com/rockymadden/stringmetric/filter/StringFilterDelegateSpec.scala
blob: 132156b80d7f206253c819f1ce706d51652f937b (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
30
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 StringFilterDelegateSpec extends ScalaTest {
	import StringFilterDelegateSpec.Filter

	"StringFilter" should provide {
		"overloaded filter method" when passed {
			"String" should returns {
				"the same String" in {
					Filter.filter("Hello World") should equal ("Hello World")
					Filter.filter("	Hello! World]") should equal ("	Hello! World]")
				}
			}
			"character array" should returns {
				"the same character array" in {
					Filter.filter("Hello World".toCharArray) should equal ("Hello World".toCharArray)
					Filter.filter("	Hello! World]".toCharArray) should equal ("	Hello! World]".toCharArray)
				}
			}
		}
	}
}

object StringFilterDelegateSpec {
	private final val Filter = new StringFilterDelegate
}