summaryrefslogtreecommitdiff
path: root/example/todo/app
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.li@databricks.com>2019-09-14 16:45:39 +0800
committerLi Haoyi <haoyi.li@databricks.com>2019-09-14 17:40:26 +0800
commit4e853a9d5b9563dbe1909757bf4be4d8e7d2b36a (patch)
tree684863947658d22f91804090c81a68d012b82b6c /example/todo/app
parent90b6806e5fb91b207f9d8e2da2a58c25928badea (diff)
downloadcask-4e853a9d5b9563dbe1909757bf4be4d8e7d2b36a.tar.gz
cask-4e853a9d5b9563dbe1909757bf4be4d8e7d2b36a.tar.bz2
cask-4e853a9d5b9563dbe1909757bf4be4d8e7d2b36a.zip
.
Diffstat (limited to 'example/todo/app')
-rw-r--r--example/todo/app/src/TodoServer.scala2
-rw-r--r--example/todo/app/test/src/ExampleTests.scala4
2 files changed, 3 insertions, 3 deletions
diff --git a/example/todo/app/src/TodoServer.scala b/example/todo/app/src/TodoServer.scala
index 4adb55c..1a58d09 100644
--- a/example/todo/app/src/TodoServer.scala
+++ b/example/todo/app/src/TodoServer.scala
@@ -17,7 +17,7 @@ object TodoServer extends cask.MainRoutes{
class transactional extends cask.Decorator{
class TransactionFailed(val value: Router.Result.Error) extends Exception
- def wrapFunction(pctx: cask.Request, delegate: Delegate): Returned = {
+ def wrapFunction(pctx: cask.Request, delegate: Delegate): OuterReturned = {
try ctx.transaction(
delegate(Map()) match{
case Router.Result.Success(t) => Router.Result.Success(t)
diff --git a/example/todo/app/test/src/ExampleTests.scala b/example/todo/app/test/src/ExampleTests.scala
index e8ca7eb..e1be23c 100644
--- a/example/todo/app/test/src/ExampleTests.scala
+++ b/example/todo/app/test/src/ExampleTests.scala
@@ -1,7 +1,7 @@
package app
import utest._
object ExampleTests extends TestSuite{
- def test[T](example: cask.main.BaseMain)(f: String => T): T = {
+ def withServer[T](example: cask.main.BaseMain)(f: String => T): T = {
val server = io.undertow.Undertow.builder
.addHttpListener(8080, "localhost")
.setHandler(example.defaultHandler)
@@ -13,7 +13,7 @@ object ExampleTests extends TestSuite{
res
}
val tests = Tests{
- 'TodoServer - test(TodoServer){ host =>
+ test("TodoServer") - withServer(TodoServer){ host =>
val page = requests.get(host).text()
assert(page.contains("What needs to be done?"))
}