如何检查一个 Matcher 片段中的多个表达式?
例如:
class Foo extends Specification {
"Retrieving open issues" should {
"return expected properties with expected data" in {
val issue = Bar.openIssues.head
issue must not beNull
issue.number must beEqualTo(1)
issue.state must beEqualTo("open")
issue.title must beEqualTo("first issue")
}
}
}
给出错误
[error] type mismatch;
[error] found : Int
[error] required: org.specs2.matcher.Matcher[Issue]
[error] issue.number must beEqualTo(1)
Eric 在此评论中引用了“经典”类型推理问题,但找不到答案。