class TestElectionVote < Test::Unit::TestCase
+ def test_plurality_empty
+ vote_array = []
+ assert_nil PluralityVote.new(vote_array).result.winners[0]
+ end
+
def test_plurality
vote_array = "ABCABCABCCCBBAAABABABCCCCCCCCCCCCCA".split("")
assert_raise(InvalidVoteError) { PluralityVote.new(vote_array).result.winners[0] }
end
+ def test_approval_empty
+ vote_array = []
+ assert_nil ApprovalVote.new(vote_array).result.winners[0]
+ end
+
def test_approval
vote_array = Array.new
10.times {vote_array << "AB".split("")}