Add testcases for calling results to empty votes.
[rubyvote] / test / range_test.rb
index 26d8600..79635ec 100644 (file)
@@ -6,6 +6,11 @@ require 'rubyvote/range'
 
 class TestRangeVote < Test::Unit::TestCase
 
+  def test_range_empty
+    vote_array = []
+    assert_nil RangeVote.new(vote_array).result.winners[0]
+  end
+  
   def test_range
     vote_array = []
     42.times {vote_array << {'A' => 10, 'B' => 5, 'C' => 2, 'D' => 1}}

Benjamin Mako Hill || Want to submit a patch?