Ho un test molto semplice come colpo:Numero unico tavolo colonna Data: Groovy: Data variabile '_' deve essere dichiarato come parametro del metodo
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 |_
}
Secondo il documento http://spock-framework.readthedocs.org/en/latest/data_driven_testing.html tabelle di dati devono avere almeno due colonne. Un tavolo a colonna singola può essere scritta come:
where:
a | _
1 | _
7 | _
0 | _
e seguo questa regola, ma ha ottenuto uno sguardo errore come immagine indicata:
Groovy:Date variable '_' needs to be declared as method parameter
così, la prego di dirmi cosa il problema è qui?
Grazie, sarà meglio se questo è documentato –
Nelle istantanee recenti, '(Status editStatus)' è supportato. –