def it_only_remove_pieces_of_turn_player(self): board = ChessBoard() field1 = board.get_field(4, 1) type(field1.piece) |should| be(Pawn) board.get_piece(4, 1) |should| be(None) type(field1.piece) |should| be(Pawn) field2 = board.get_field(4, 6) type(field2.piece) |should| be(Pawn) white_pawn = board.get_piece(4, 6) field2.piece |should| be(None) type(white_pawn) |should| be(Pawn)
def it_can_remove_a_piece(self): board = ChessBoard() field = board.get_field(4, 6) type(field.piece) |should| be(Pawn) white_pawn = board.get_piece(4, 6) field.piece |should| be(None) type(white_pawn) |should| be(Pawn)
def it_can_put_a_piece(self): board = ChessBoard() origin_field = board.get_field(2, 6) target_field = board.get_field(2, 4) board.turn |should| equal_to("white") type(origin_field.piece) |should| be(Pawn) target_field.piece |should| be(None) white_pawn = board.get_piece(2, 6) board.put_piece(white_pawn, 2, 4) board.turn |should| equal_to("black") origin_field.piece |should| be(None) type(target_field.piece) |should| be(Pawn)