From 522d0c3fa4fad7dfcdbc87bdb9c0af0510a7c210 Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Sun, 29 Jun 2008 01:05:04 +0100 Subject: [PATCH] Add illegal move test. --- test/games/shogi/test_shogi_validation.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/games/shogi/test_shogi_validation.rb b/test/games/shogi/test_shogi_validation.rb index 27054d1..dafc59c 100644 --- a/test/games/shogi/test_shogi_validation.rb +++ b/test/games/shogi/test_shogi_validation.rb @@ -154,4 +154,11 @@ class TestShogiValidation < Test::Unit::TestCase assert_not_valid 4, 4, 2, 2 assert_not_valid 4, 4, 4, 4 end + + def test_illegal_move + @board[Point.new(4, 6)] = Chess::Piece.new(:white, :pawn) + assert_valid 4, 8, 5, 7 + assert_valid 4, 8, 3, 7 + assert_not_valid 4, 8, 4, 7 + end end -- 2.11.4.GIT