4 require 'election_test_helper'
6 class TestRangeVote < Test::Unit::TestCase
7 include ElectionTestHelper
11 42.times {vote_array << {'A' => 10, 'B' => 5, 'C' => 2, 'D' => 1}}
12 26.times {vote_array << {'A' => 1, 'B' => 10, 'C' => 5, 'D' => 2}}
13 15.times {vote_array << {'A' => 1, 'B' => 2, 'C' => 10, 'D' => 5}}
14 17.times {vote_array << {'A' => 1, 'B' => 2, 'C' => 5, 'D' => 10}}
16 test_winner('B', RangeVote.new(vote_array).result )
21 10.times {vote_array << {'A' => 5, 'B' => 2}}
22 10.times {vote_array << {'A' => 2, 'B' => 5}}
24 test_winner(['A','B'], RangeVote.new(vote_array).result )
30 test_winner(nil, RangeVote.new(vote_array).result )