test/progressrus_test.rb in progressrus-0.1.5 vs test/progressrus_test.rb in progressrus-0.1.6
- old
+ new
@@ -117,9 +117,16 @@
def test_percentage_should_be_0_if_count_0
assert_equal 0, @progress.percentage
end
+ def test_percentage_should_be_nil_if_total_nil
+ progress = Progressrus.new(total: nil)
+ assert_nil progress.percentage
+ progress.tick
+ assert_nil progress.percentage
+ end
+
def test_percentage_should_be_1_if_total_0
progress = Progressrus.new(total: 0)
assert_equal 1, progress.percentage
progress.tick
assert_equal 1, progress.percentage