X-Git-Url: https://projects.mako.cc/source/rubyvote/blobdiff_plain/0ef8f53fb812bcc40337a92f9c4d11ab193f73a9..d01ccdbbf0b98a7b6a3c67a51ff6752a80b890a3:/test/election_test.rb?ds=sidebyside diff --git a/test/election_test.rb b/test/election_test.rb index b182e2d..e8a9c45 100644 --- a/test/election_test.rb +++ b/test/election_test.rb @@ -1,15 +1,14 @@ -#!/usr/bin/ruby +#!/usr/bin/ruby -Ilib require 'test/unit' -require 'election_test_helper' +require 'rubyvote/election' class TestElectionVote < Test::Unit::TestCase - include ElectionTestHelper def test_plurality vote_array = "ABCABCABCCCBBAAABABABCCCCCCCCCCCCCA".split("") - test_winner( "C", PluralityVote.new(vote_array).result ) + assert_equal( "C", PluralityVote.new(vote_array).result.winners[0] ) end @@ -20,7 +19,7 @@ class TestElectionVote < Test::Unit::TestCase 11.times {vote_array << "AC".split("")} 5.times {vote_array << "A".split("")} - test_winner( "A", ApprovalVote.new(vote_array).result ) + assert_equal( "A", ApprovalVote.new(vote_array).result.winners[0] ) end end