【发布时间】:2016-04-05 09:29:28
【问题描述】:
class ServiceTest extends PlaySpecification with Mockito {
override def is =
s2"""
This is Service Specification
The Service should create element in right way $init
"""
val metricId = 1
val hashid = HashIdGenerator.hashId(metricId)
def init = 1 mustEqual (1)
}
HashIdGenerator 需要启动播放应用程序,播放文档显示我们需要通过这种方式获取播放应用程序:https://www.playframework.com/documentation/2.1.0/ScalaTest
"Computer model" should {
"be retrieved by id" in new WithApplication {
// your test code
}
"be retrieved by email" in new WithApplication {
// your test code
}
}
但我不喜欢这种 'should in' 风格,所以我怎样才能获得一个 play 应用程序并同时继续使用 'is' 风格。
【问题讨论】:
标签: playframework playframework-2.0 specs2