4 require 'rubyvote/election'
6 class TestElectionVote < Test::Unit::TestCase
9 vote_array = "ABCABCABCCCBBAAABABABCCCCCCCCCCCCCA".split("")
11 assert_equal( "C", PluralityVote.new(vote_array).result.winners[0] )
14 def test_plurality_nonstring
15 vote_array = [1,2,3,1,1,1,2,3]
16 assert_equal( 1, PluralityVote.new(vote_array).result.winners[0] )
21 vote_array = Array.new
22 10.times {vote_array << "AB".split("")}
23 10.times {vote_array << "CB".split("")}
24 11.times {vote_array << "AC".split("")}
25 5.times {vote_array << "A".split("")}
27 assert_equal( "A", ApprovalVote.new(vote_array).result.winners[0] )