projects
/
rubyvote
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d01ccdb
)
Add testcase for non-string plurality vote candidates
author
John Dong
<jdong@mit.edu>
Tue, 14 Aug 2007 23:31:48 +0000
(23:31 +0000)
committer
John Dong
<jdong@mit.edu>
Tue, 14 Aug 2007 23:31:48 +0000
(23:31 +0000)
git-svn-id: svn://rubyforge.org/var/svn/rubyvote/trunk@30
1440c7f4
-e209-0410-9a04-
881b5eb134a8
test/election_test.rb
patch
|
blob
|
history
diff --git
a/test/election_test.rb
b/test/election_test.rb
index e8a9c452f1cb7c8f1f2993d66591e32f61692ab4..5b5664e7eaabf55c9dc9e0ed63da5c7e211be7aa 100644
(file)
--- a/
test/election_test.rb
+++ b/
test/election_test.rb
@@
-11,6
+11,11
@@
class TestElectionVote < Test::Unit::TestCase
assert_equal( "C", PluralityVote.new(vote_array).result.winners[0] )
end
assert_equal( "C", PluralityVote.new(vote_array).result.winners[0] )
end
+ def test_plurality_nonstring
+ vote_array = [1,2,3,1,1,1,2,3]
+ assert_equal( 1, PluralityVote.new(vote_array).result.winners[0] )
+ end
+
def test_approval
vote_array = Array.new
def test_approval
vote_array = Array.new
Benjamin Mako Hill
||
Want to submit a patch?