有一个类InvokeLater
,定义如下:
class InvokeLater {
def apply(f: => Any): Unit = {
// do something ...
f
// do some other thing
}
}
在规格测试中,我嘲笑它:
val invokeLater = mock[InvokeLater]
invokeLater.apply(any) answers { f => f:Unit }
但似乎里面的代码answers
永远不会运行。
specs2 现在支持这个功能吗?