Created
November 14, 2012 08:32
-
-
Save FranckSilvestre/4070999 to your computer and use it in GitHub Desktop.
Easy data driven with Spock
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
package chess | |
import spock.lang.Specification | |
import spock.lang.Unroll | |
import static chess.PieceCouleur.BLANC | |
import static chess.PieceCouleur.NOIR | |
class PionSpecification2 extends Specification { | |
@Unroll | |
def "deplacement du pion"() { | |
expect: | |
new Pion(positionHorizontale: posHor, | |
positionVerticale: posVer, pieceCouleur: couleur).bouge(depHor, depVer) == depCorrect | |
where: | |
couleur | posHor | posVer | depHor | depVer | depCorrect | |
BLANC | "a" | 2 | 0 | 3 | false | |
BLANC | "a" | 2 | 0 | 2 | true | |
BLANC | "a" | 3 | 0 | 2 | false | |
BLANC | "a" | 3 | 0 | 1 | true | |
BLANC | "a" | 3 | 0 | -1 | false | |
NOIR | "a" | 7 | 0 | -1 | true | |
NOIR | "a" | 7 | 0 | 1 | false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment