OSDN Git Service

Merge branch '201312-fix-sacrifice'
[shogi-server/shogi-server.git] / test / TC_floodgate.rb
index de49da3..56e242e 100644 (file)
@@ -24,12 +24,12 @@ class TestFloodgate < Test::Unit::TestCase
   end
 
   def test_instance_game_name
-    fg = ShogiServer::League::Floodgate.new(nil, "floodgate-900-0")
-    assert(fg.game_name?("floodgate-900-0"))
-    assert(!fg.game_name?("floodgate-3600-0"))
-    fg = ShogiServer::League::Floodgate.new(nil, "floodgate-3600-0")
+    fg = ShogiServer::League::Floodgate.new(nil, {:game_name => "floodgate-900-0"})
     assert(fg.game_name?("floodgate-900-0"))
     assert(!fg.game_name?("floodgate-3600-0"))
+    fg = ShogiServer::League::Floodgate.new(nil, {:game_name => "floodgate-3600-0"})
+    assert(!fg.game_name?("floodgate-900-0"))
+    assert(fg.game_name?("floodgate-3600-0"))
   end
 
 end
@@ -88,7 +88,8 @@ class TestMakeEven < Test::Unit::TestCase
  def test_match_odd
     players = [@a, @b, @c]
     @pairing.match(players)
-    assert_equal([@a, @b], players)
+    assert_equal(2, players.size)
+    assert(players[0] != players[1])
   end
 end
 
@@ -137,7 +138,10 @@ class TestRandomize < Test::Unit::TestCase
   def test_match
     players = [@a, @b, @c]
     @pairing.match(players)
-    assert_equal([@b,@a,@c], players)
+    assert_equal(3, players.size)
+    assert(players.include? @a)
+    assert(players.include? @b)
+    assert(players.include? @c)
   end
 end