OSDN Git Service

38f9b49f6299b4c0fe43ac5afc6ec709667aa0b8
[shogi-server/shogi-server.git] / test / TC_jishogi_kachi.rb
1 require "baseclient"
2 include Socket::Constants
3
4 class JishogiTest < ReadFileClient
5   def test_jishogi_kachi
6     csa = File.open(filepath("jishogi_kachi.csa")) {|f| f.read}
7     handshake(csa)
8     cmd2 "%KACHI"
9     sleep 1
10     result1 = cmd ""
11     result2 = cmd2 ""
12     result1 += read_nonblock(@socket1)
13     result2 += read_nonblock(@socket2)
14     logout12
15     assert_match(/#JISHOGI.#LOSE/m, result1)
16     assert_match(/#JISHOGI.#WIN/m, result2)
17   end
18 end # Client class