Skip to content

Instantly share code, notes, and snippets.

@aslakhellesoy
Created January 26, 2011 00:38
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save aslakhellesoy/796009 to your computer and use it in GitHub Desktop.
Save aslakhellesoy/796009 to your computer and use it in GitHub Desktop.
Let's cuke some chess...
Feature: Validate moves
Scenario: Moving the knight illegally
Given the following board:
| | | | | | | | |8|
| | | | | | | | |7|
| | | | | | | | |6|
| | | | | | | | |5|
| | | |♞| | | | |4|
| | | | | | | | |3|
|♙| | | | | | | |2|
| | | | | | | | |1|
|a|b|c|d|e|f|g|h| |
When I attempt d4-d5
Then I should be shown "Illegal move"
Given(/the following board:/) do |board|
# Create a board, but shave off the sidelines first
@board = Board.new(board[0..-2].transpose[0..-2].transpose)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment