我有这样的代码
"When some call is made, status is (+value+)" in {
Get("/path") ~> routeToCall ~> check {
// some statements
status === OK <---- this value I want in When Statment
}
}
无论我们得到什么状态是好还是失败,我都想在“当.......状态正常”的某些事情上。
答案 0 :(得分:0)
使用specs2-gwt
模块,您可以编写类似
class APISpec extends mutable.Specification with
org.specs2.specification.dsl.mutable.GWT with
StandardDelimitedStepParsers {
"When some call is made, status is {OK}".example(aString) { expected: String =>
Get("/path") ~> routeToCall ~> check {
// some statements
status === expected
}
}
}
请查看documentation了解更多示例。