summaryrefslogtreecommitdiff
path: root/cask/test/src/test
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-07-26 00:15:18 +0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-07-26 00:15:18 +0800
commit3654b08845673a5a83be46f4bdcf885d0fad3341 (patch)
treef745984000361ec671ec4dd501b0f487bf99d79f /cask/test/src/test
parentf4e21bca86ec7c2b2ab96b9c0daa573a8b448efc (diff)
downloadcask-3654b08845673a5a83be46f4bdcf885d0fad3341.tar.gz
cask-3654b08845673a5a83be46f4bdcf885d0fad3341.tar.bz2
cask-3654b08845673a5a83be46f4bdcf885d0fad3341.zip
First decorator unit test works
Diffstat (limited to 'cask/test/src/test')
-rw-r--r--cask/test/src/test/cask/Decorator.scala4
-rw-r--r--cask/test/src/test/cask/ExampleTests.scala2
2 files changed, 3 insertions, 3 deletions
diff --git a/cask/test/src/test/cask/Decorator.scala b/cask/test/src/test/cask/Decorator.scala
index 0e31019..e8927cf 100644
--- a/cask/test/src/test/cask/Decorator.scala
+++ b/cask/test/src/test/cask/Decorator.scala
@@ -10,9 +10,9 @@ object Decorator extends cask.MainRoutes{
def handle(ctx: ParamContext) = Map("extra" -> 31337)
def parseMethodInput[T] = new ArgReader[Int, T, ParamContext] {
- def arity = 0
+ def arity = 1
- def read(ctx: ParamContext, label: String, input: Int) = 0.asInstanceOf[T]
+ def read(ctx: ParamContext, label: String, input: Int) = input.asInstanceOf[T]
}
}
diff --git a/cask/test/src/test/cask/ExampleTests.scala b/cask/test/src/test/cask/ExampleTests.scala
index 8787b3a..be0000c 100644
--- a/cask/test/src/test/cask/ExampleTests.scala
+++ b/cask/test/src/test/cask/ExampleTests.scala
@@ -87,7 +87,7 @@ object ExampleTests extends TestSuite{
"OK Plain(hello,null) List(1, 2)"
}
'Decorator - test(Decorator){ host =>
- requests.get(host + "/hello/woo").text()
+ requests.get(host + "/hello/woo").text() ==> "woo31337"
}
}