Scala 如何将数据表与其他匹配器组合?
我试图使用specs2数据表填充一个容器,然后检查其中的一些条件。问题是DataTable之后的匹配器被忽略。考虑下面的代码Scala 如何将数据表与其他匹配器组合?,scala,specs2,Scala,Specs2,我试图使用specs2数据表填充一个容器,然后检查其中的一些条件。问题是DataTable之后的匹配器被忽略。考虑下面的代码 class MySpec extends Specification with DataTables { "A Container" should { "after data is added container should have the following data" in new TestContainer { "a" | "flag" | "d"
class MySpec extends Specification with DataTables {
"A Container" should {
"after data is added container should have the following data" in new TestContainer {
"a" | "flag" | "d" |
100 ! 1 ! "abc" |
300 ! 1 ! "abc" |
200 ! 0 ! "xyz" |>
{ (a, flag, d) =>
container.add(Data(a, flag, d)) must not(throwA[Exception])
}
container.size must_== 3 // Ignored
1 must_== 2 // Ignored
}
}
}
请让我知道我遗漏了什么,以及如何使标记为
//忽略的行被验证。对不起,这是一个错误。它已在最新的2.4-SNAPSHOT中修复