Created
July 29, 2011 07:35
-
-
Save sourcerebels/1113390 to your computer and use it in GitHub Desktop.
Spock Source Rebels Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spock.lang.* | |
def "criterio de aceptacion"() { | |
setup: "contexto en el que se ejecuta" | |
expect: "comportamiento que se quiere probar" | |
where: "casos que se prueban" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spock.lang.* | |
def "buscar en la agenda"() { | |
setup: "Agenda con tres entradas: Edu, Mon, Humita" | |
expect: "encuentra las entradas" | |
where: "la palabra de busqueda es una de las entradas de la agenda" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spock.lang.* | |
def "buscar en la agenda"() { | |
setup: "Agenda con tres entradas: Edu, Mon, Humita" | |
agenda = ["Edu", "Mon", "Humita"] | |
expect: "encuentra las entradas" | |
agenda.find{ w -> w == name } == result | |
where: "la palabra de busqueda es una de las entradas de la agenda" | |
name | result | |
"Mon" | "Mon" | |
"Ibak" | null | |
"Pepe" | null | |
"Humita"| "Humita" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: "groovy" | |
repositories { | |
mavenCentral() | |
mavenRepo urls: "http://m2repo.spockframework.org/snapshots" | |
} | |
dependencies { | |
groovy "org.codehaus.groovy:groovy-all:1.7.4" | |
testCompile "org.spockframework:spock-core:0.4-groovy-1.7" | |
testCompile "junit:junit:4.8.1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment