OSDN Git Service

test/TC_floodgate.rb Improved randomness check so that it works on Ruby 2.0.0 as...
authorDaigo Moriwaki <daigo@debian.org>
Sat, 23 Nov 2013 12:00:15 +0000 (21:00 +0900)
committerDaigo Moriwaki <daigo@debian.org>
Sat, 23 Nov 2013 12:00:15 +0000 (21:00 +0900)
changelog
test/TC_floodgate.rb

index 36c2ae8..077bc80 100644 (file)
--- a/changelog
+++ b/changelog
@@ -2,6 +2,8 @@
 
        * [mk_rate]
          - gsl library may be provided as a gem
+       * test/TC_floodgate.rb
+         - Improved randomness check so that it works on Ruby 2.0.0 as well
 
 2013-11-04  Daigo Moriwaki <daigo at debian dot org>
 
index c53d9a1..56e242e 100644 (file)
@@ -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