$topdir = File.expand_path File.dirname(__FILE__)
require 'test/unit'
require 'tempfile'
-require 'mock_game'
-require 'mock_log_message'
+require 'test/mock_game'
+require 'test/mock_log_message'
require 'test/mock_player'
require 'shogi_server/login'
require 'shogi_server/player'
assert @buoy.is_new_game?("buoy_hoge-1500-0")
cmd = ShogiServer::SetBuoyCommand.new "%%SETBUOY", @p, "buoy_hoge-1500-0", "+7776FU", 2
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert !@buoy.is_new_game?("buoy_hoge-1500-0")
assert !$p1.out.empty?
assert !$p2.out.empty?
assert @buoy.is_new_game?("buoy_hoge-1500-0")
cmd = ShogiServer::SetBuoyCommand.new "%%SETBUOY", @p, "buoy_hoge-1500-0", "+7776FU", 1
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert @buoy.is_new_game?("buoy_hoge-1500-0")
assert !$p1.out.empty?
assert !$p2.out.empty?
assert @buoy.is_new_game?("buoy_hoge-1500-0")
cmd = ShogiServer::SetBuoyCommand.new "%%SETBUOY", @p, "buoyhoge-1500-0", "+7776FU", 1
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert $p1.out.empty?
assert $p2.out.empty?
assert @buoy.is_new_game?("buoy_hoge-1500-0")
cmd = ShogiServer::SetBuoyCommand.new "%%SETBUOY", @p, "buoy_duplicated-1500-0", "+7776FU", 1
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert $p1.out.empty?
assert $p2.out.empty?
assert !@buoy.is_new_game?("buoy_duplicated-1500-0")
assert @buoy.is_new_game?("buoy_badmoves-1500-0")
cmd = ShogiServer::SetBuoyCommand.new "%%SETBUOY", @p, "buoy_badmoves-1500-0", "+7776FU+8786FU", 1
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert $p1.out.empty?
assert $p2.out.empty?
assert @buoy.is_new_game?("buoy_badmoves-1500-0")
assert @buoy.is_new_game?("buoy_badcounter-1500-0")
cmd = ShogiServer::SetBuoyCommand.new "%%SETBUOY", @p, "buoy_badcounter-1500-0", "+7776FU", 0
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert $p1.out.empty?
assert $p2.out.empty?
assert @buoy.is_new_game?("buoy_badcounter-1500-0")
assert !@buoy.is_new_game?(buoy_game.game_name)
cmd = ShogiServer::DeleteBuoyCommand.new "%%DELETEBUOY", @p, buoy_game.game_name
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert $p1.out.empty?
assert $p2.out.empty?
assert @buoy.is_new_game?(buoy_game.game_name)
assert @buoy.is_new_game?(buoy_game.game_name)
cmd = ShogiServer::DeleteBuoyCommand.new "%%DELETEBUOY", @p, buoy_game.game_name
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert $p1.out.empty?
assert $p2.out.empty?
assert @buoy.is_new_game?(buoy_game.game_name)
cmd = ShogiServer::DeleteBuoyCommand.new "%%DELETEBUOY", @p, buoy_game.game_name
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert_equal "##[ERROR] you are not allowed to delete a buoy game that you did not set: buoy_anotherplayer-1500-0\n", @p.out.first
assert !@buoy.is_new_game?(buoy_game.game_name)
end
assert !@buoy.is_new_game?(buoy_game.game_name)
cmd = ShogiServer::GetBuoyCountCommand.new "%%GETBUOYCOUNT", @p, buoy_game.game_name
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert_equal ["##[GETBUOYCOUNT] 1\n", "##[GETBUOYCOUNT] +OK\n"], @p.out
end
assert @buoy.is_new_game?(buoy_game.game_name)
cmd = ShogiServer::GetBuoyCountCommand.new "%%GETBUOYCOUNT", @p, buoy_game.game_name
rt = cmd.call
- assert :continue, rt
+ assert_equal :continue, rt
assert_equal ["##[GETBUOYCOUNT] -1\n", "##[GETBUOYCOUNT] +OK\n"], @p.out
end
end