覆盖率插件(Cobertura under the hood)是否报告 Spock 规范?
中解释的测试
使用 grails test-app unit:spock -coverage
我运行了“即使使用 Spocks 的 Mock() 模拟底层控制器,为什么此方法仍返回 null?”
现在覆盖率报告“认为”方法 createCrumb 尚未经过测试。
With grails test-app unit:spock -coverage
I ran the test explained at
Now the coverage report "thinks" that the method createCrumb has not been tested.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上我的命令有一个拼写错误。作为类型,我编写了 spoc 而不是 spock,导致根本没有测试运行。
grails test-app unit:spoc -coverage
将其更改为正确的值后,测试实际运行并且覆盖率报告包含它们。
所以:是的,覆盖率插件确实会报告 Spock 规范。
I actually had a typo in my command. As type I wrote spoc instead of spock, causing no tests to run at all.
grails test-app unit:spoc -coverage
After changing this to the correct values, the tests were actually run and the coverage report contained them.
So: YES, the coverage plugin DOES report on Spock specifications.