-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get legal moves via move_types from piece for board
- Loading branch information
Roland Studer
committed
Dec 23, 2021
1 parent
51a3173
commit cd0a933
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require "minitest/autorun" | ||
|
||
class Piece | ||
class RookTest < Minitest::Test | ||
def test_rook_can_move_horizontally | ||
board = Board.new | ||
board.place(Rook.new, "A1") | ||
assert_includes board.legal_moves_for("A1"), Position.parse("H8") | ||
end | ||
end | ||
end |