OSDN Git Service

* [shogi-server]
[shogi-server/shogi-server.git] / test / TC_oute_sennichite.rb
1 require "baseclient"
2 include Socket::Constants
3
4 class OuteSennichiteTest < ReadFileClient
5   def test_oute_sennichite
6     csa = File.open(filepath("oute_sennichite.csa")) {|f| f.read}
7     handshake(csa)
8     #cmd2 "%KACHI"
9     sleep 1
10     result1 = read_nonblock(@socket1)
11     result2 = read_nonblock(@socket2)
12     logout12
13     assert_match(/#OUTE_SENNICHITE.#LOSE/m, result1)
14     assert_match(/#OUTE_SENNICHITE.#WIN/m, result2)
15   end
16
17   def test_oute_sennichite2
18     csa = File.open(filepath("oute_sennichite2.csa")) {|f| f.read}
19     handshake(csa)
20     #cmd2 "%KACHI"
21     sleep 1
22     result1 = read_nonblock(@socket1)
23     result2 = read_nonblock(@socket2)
24     logout12
25     assert_match(/#OUTE_SENNICHITE.#WIN/m, result1)
26     assert_match(/#OUTE_SENNICHITE.#LOSE/m, result2)
27   end
28
29   def test_oute_sennichite3
30     csa = File.open(filepath("oute_sennichite3.csa")) {|f| f.read}
31     handshake(csa)
32     #cmd2 "%KACHI"
33     sleep 1
34     result1 = read_nonblock(@socket1)
35     result2 = read_nonblock(@socket2)
36     logout12
37     assert_match(/#OUTE_SENNICHITE.#LOSE/m, result1)
38     assert_match(/#OUTE_SENNICHITE.#WIN/m, result2)
39   end
40 end # Client class
41