shogi-server source
Revision | 922cac230563070d38419c8248b56188a3fce4bf (tree) |
---|---|
Zeit | 2020-12-06 16:19:09 |
Autor | Daigo Moriwaki <beatles@sgtp...> |
Commiter | Daigo Moriwaki |
Fix test cases
@@ -90,7 +90,7 @@ class TestFactoryMethod < Test::Unit::TestCase | ||
90 | 90 | |
91 | 91 | def test_keep_alive_command |
92 | 92 | cmd = ShogiServer::Command.factory("", @p) |
93 | - assert_instance_of(ShogiServer::KeepAliveCommand, cmd) | |
93 | + assert_instance_of(ShogiServer::SpecialCommand, cmd) | |
94 | 94 | end |
95 | 95 | |
96 | 96 | def test_move_command |
@@ -214,7 +214,7 @@ class TestFactoryMethod < Test::Unit::TestCase | ||
214 | 214 | end |
215 | 215 | |
216 | 216 | def test_space_command |
217 | - cmd = ShogiServer::Command.factory(" ", @p) | |
217 | + cmd = ShogiServer::Command.factory(" ", @p) | |
218 | 218 | assert_instance_of(ShogiServer::SpaceCommand, cmd) |
219 | 219 | end |
220 | 220 |
@@ -315,20 +315,6 @@ end | ||
315 | 315 | |
316 | 316 | # |
317 | 317 | # |
318 | -class TestKeepAliveCommand < Test::Unit::TestCase | |
319 | - def setup | |
320 | - @p = MockPlayer.new | |
321 | - end | |
322 | - | |
323 | - def test_call | |
324 | - cmd = ShogiServer::KeepAliveCommand.new("", @p) | |
325 | - rc = cmd.call | |
326 | - assert_equal(:continue, rc) | |
327 | - end | |
328 | -end | |
329 | - | |
330 | -# | |
331 | -# | |
332 | 318 | class TestMoveCommand < Test::Unit::TestCase |
333 | 319 | def setup |
334 | 320 | @p = MockPlayer.new |
@@ -417,6 +403,12 @@ class TestSpecialComand < Test::Unit::TestCase | ||
417 | 403 | rc = cmd.call |
418 | 404 | assert_equal(:continue, rc) |
419 | 405 | end |
406 | + | |
407 | + def test_keep_alive | |
408 | + cmd = ShogiServer::SpecialCommand.new("", @p) | |
409 | + rc = cmd.call | |
410 | + assert_equal(:continue, rc) | |
411 | + end | |
420 | 412 | end |
421 | 413 | |
422 | 414 | # |
@@ -822,7 +814,7 @@ class TestSpaceCommand < Test::Unit::TestCase | ||
822 | 814 | end |
823 | 815 | |
824 | 816 | def test_call |
825 | - cmd = ShogiServer::SpaceCommand.new("", @p) | |
817 | + cmd = ShogiServer::SpaceCommand.new(" ", @p) | |
826 | 818 | rc = cmd.call |
827 | 819 | |
828 | 820 | assert_equal(:continue, rc) |
@@ -30,3 +30,7 @@ def log_info(msg) | ||
30 | 30 | $logger.info(msg) |
31 | 31 | end |
32 | 32 | |
33 | +def log_debug(msg) | |
34 | + $logger.info(msg) | |
35 | +end | |
36 | + |