2 require 'games/chess/chess'
4 class ChessPolicyTest < Test::Unit::TestCase
5 include ValidationHelper
8 @chess = Chess::Game.new
9 @policy = @chess.policy
10 @state = @chess.new_state
17 assert_not_movable 4, 1
18 assert_not_movable 5, 5
21 def test_movable_empty
22 assert_not_movable 2, 3
23 assert_not_movable 7, 6
26 def test_movable_out_of_board
27 assert_not_movable 23, 1
28 assert_not_movable 6, 54
29 assert_not_movable -7, 42
34 def assert_movable(*args)
35 assert @policy.movable?(@state, unpack_point(*args))
38 def assert_not_movable(*args)
39 assert !@policy.movable?(@state, unpack_point(*args))