OSDN Git Service

* [shogi-server]
[shogi-server/shogi-server.git] / test / TC_before_agree.rb
1 require "baseclient"
2 require "kconv"
3
4 class TestBeforeAgree < BaseClient
5
6   def test_before_agree_gote_logout
7     login
8     result  = cmd  "AGREE"
9     result2 = cmd2 "LOGOUT"
10
11     result  += read_nonblock(@socket1)
12     result2 += read_nonblock(@socket2)
13
14     assert(/^REJECT/ =~ result)
15     assert(/^REJECT/ =~ result2)
16   end
17
18   def test_before_agree_sente_logout
19     login
20     sleep 0.5
21     result2 = cmd2 "AGREE"
22     result  = cmd  "LOGOUT"
23
24     result  += read_nonblock(@socket1)
25     result2 += read_nonblock(@socket2)
26
27     assert(/^REJECT/ =~ result)
28     assert(/^REJECT/ =~ result2)
29   end
30 end