projects
/
rubyvote
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add testcases for calling results to empty votes.
[rubyvote]
/
test
/
positional_test.rb
diff --git
a/test/positional_test.rb
b/test/positional_test.rb
index 1dc6c125099a80126517bc4bc8c0e7542e547fee..76be74d7c55e2b88c32b6874e888e3d46a00e495 100644
(file)
--- a/
test/positional_test.rb
+++ b/
test/positional_test.rb
@@
-5,7
+5,12
@@
require 'rubyvote/election'
require 'rubyvote/positional'
class TestPositionalVote < Test::Unit::TestCase
require 'rubyvote/positional'
class TestPositionalVote < Test::Unit::TestCase
-
+
+ def test_borda_empty
+ vote_array = Array.new
+ assert_nil BordaVote.new(vote_array).result.winners[0]
+ end
+
def test_borda
vote_array = Array.new
2.times {vote_array << "BAC".split("")}
def test_borda
vote_array = Array.new
2.times {vote_array << "BAC".split("")}
Benjamin Mako Hill
||
Want to submit a patch?