projects
/
rubyvote
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add somewhat hackish fix for PureCondorcetVote.new([]).result deadlocking
[rubyvote]
/
test
/
election_test.rb
diff --git
a/test/election_test.rb
b/test/election_test.rb
index 5b5664e7eaabf55c9dc9e0ed63da5c7e211be7aa..7675e58a01c8eb1fe4a254d57f6204062dc27619 100644
(file)
--- a/
test/election_test.rb
+++ b/
test/election_test.rb
@@
-16,7
+16,11
@@
class TestElectionVote < Test::Unit::TestCase
assert_equal( 1, PluralityVote.new(vote_array).result.winners[0] )
end
assert_equal( 1, PluralityVote.new(vote_array).result.winners[0] )
end
-
+ def test_invalid_voteobj
+ vote_array = [1,2,nil,1]
+ assert_raise(InvalidVoteError) { PluralityVote.new(vote_array).result.winners[0] }
+ end
+
def test_approval
vote_array = Array.new
10.times {vote_array << "AB".split("")}
def test_approval
vote_array = Array.new
10.times {vote_array << "AB".split("")}
Benjamin Mako Hill
||
Want to submit a patch?