Add testcase example.

This commit is contained in:
takezoe
2013-10-03 14:02:54 +09:00
parent f37eca7c61
commit 537773f975

View File

@@ -0,0 +1,21 @@
package util
import org.specs2.mutable._
class StringUtilSpec extends Specification {
"urlDecode" should {
"decode encoded string to original string" in {
val encoded = StringUtil.urlEncode("あいうえお")
StringUtil.urlDecode(encoded) mustEqual "あいうえお"
}
}
"splitWords" should {
"split string by whitespaces" in {
val split = StringUtil.splitWords("aa bb\tcc dd \t ee")
split mustEqual Array("aa", "bb", "cc", "dd", "ee")
}
}
}