Skip to content

Instantly share code, notes, and snippets.

@FranckSilvestre
Created November 13, 2012 16:33
Show Gist options
  • Save FranckSilvestre/4066800 to your computer and use it in GitHub Desktop.
Save FranckSilvestre/4066800 to your computer and use it in GitHub Desktop.
Spécification basique avec Spock
package chess
import spock.lang.Specification
class PionSpecification extends Specification{
def "deplacement du pion"() {
expect:
new Pion(positionHorizontale: "a", positionVerticale: 2,
pieceCouleur: PieceCouleur.BLANC).bouge(0,3) == false
new Pion(positionHorizontale: "a", positionVerticale: 2,
pieceCouleur: PieceCouleur.BLANC).bouge(0,2) == true
new Pion(positionHorizontale: "a", positionVerticale: 3,
pieceCouleur: PieceCouleur.BLANC).bouge(0,2) == false
new Pion(positionHorizontale: "a", positionVerticale: 3,
pieceCouleur: PieceCouleur.BLANC).bouge(0,1) == true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment