I have a very simple test as blow:
def "setContent_activity_finished"(Status editStatus) {
// Variables.........................
given:
activity.getStatus() >> editStatus.toString()
when:
handler.setContent(activityId,jsonString)
then:
0*view.appendPossible(_)
where:
editStatus |_
FINISHED |_
CANCELED |_
}
According to the document http://spock-framework.readthedocs.org/en/latest/data_driven_testing.html Data tables must have at least two columns. A single-column table can be written as:
where:
a | _
1 | _
7 | _
0 | _
And I follow this rule,but got an error look like picture shown:
Groovy:Date variable '_' needs to be declared as method parameter
so,please tell me What the problem is here?
(Status editStatus)
is supported. – Krebs