【发布时间】:2016-05-02 15:08:07
【问题描述】:
我想编写使用where: 的参数化测试来验证是否调用了方法x。我想将x 作为参数传递。像
when:
someService.request(input)
then:
1 * (closure.call(otherService))
where
input | closure
1 | {OtherService service -> service.method1(2, 3)}
2 | {OtherService service -> service.method2(4, 5, 6)}
但我得到一个错误:
Too few invocations for:
1 * (closure.call(otherService)) (0 invocations)
Unmatched invocations (ordered by similarity):
1 * otherService.deleteUserMessage(2,3)
我想做的事可能吗?
【问题讨论】: