=docs #18012 complete remaining TODO sections in scala HTTP docs

This commit is contained in:
Mathias 2015-07-17 16:18:18 +02:00
parent cf11eab9ae
commit 1441f201b1
19 changed files with 519 additions and 51 deletions

View file

@ -0,0 +1,27 @@
/*
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package docs.http.scaladsl
import akka.stream.testkit.AkkaSpec
class UnmarshalSpec extends AkkaSpec {
"use unmarshal" in {
import akka.http.scaladsl.unmarshalling.Unmarshal
import system.dispatcher
import scala.concurrent.Await
import scala.concurrent.duration._ // ExecutionContext
val intFuture = Unmarshal("42").to[Int]
val int = Await.result(intFuture, 1.second) // don't block in non-test code!
int shouldEqual 42
val boolFuture = Unmarshal("off").to[Boolean]
val bool = Await.result(boolFuture, 1.second) // don't block in non-test code!
bool shouldBe false
}
}