Sha256: 3e96c8bc03e85ab7478cbf56768ceafac4e9c86668bea1cc77d4ddbac343bf75
Contents?: true
Size: 603 Bytes
Versions: 3
Compression:
Stored size: 603 Bytes
Contents
require 'test_helper' class ChessTest < Minitest::Test TestHelper.pgns('valid').each do |file| name = File.basename(file, '.pgn') define_method :"test_pgn_#{name}" do pgn = Chess::Pgn.new(file) game = Chess::Game.new pgn.moves.each do |m| game.move(m) assert(game.board.check?) if m.match?(/\+$/) assert(game.board.checkmate?) if m.match?(/\#$/) end end define_method :"test_pgn_result_#{name}" do pgn = Chess::Pgn.new(file) game = Chess::Game.load_pgn(file) assert_equal(pgn.result, game.result) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
chess-0.4.0 | test/test_pgn_collection.rb |
chess-0.3.6 | test/test_pgn_collection.rb |
chess-0.3.5 | test/test_pgn_collection.rb |