【发布时间】:2017-02-15 16:44:40
【问题描述】:
目前,当我在 Groovy - spock when: 中使用 if else 时,只执行 if 而 else 不执行。有没有其他方法可以在 spock 测试中实现 if-else?我尝试了 switch case 并遇到了同样的情况。
if (value == 'x' || 'y' || 'z') {
//execute below info
} else if (value == 'a') {
//execute below info
}
【问题讨论】:
-
为什么会有这个:``` || 'y' || 'y' ```?
标签: java testing groovy automated-tests spock