test/test.rb in progressbar-0.9.0 vs test/test.rb in progressbar-0.9.1
- old
+ new
@@ -49,13 +49,13 @@
}
pbar.finish
end
def test_inc_x
- total = File.size("../lib/progressbar.rb")
+ total = File.size("lib/progressbar.rb")
pbar = do_make_progress_bar("test(inc(x))", total)
- File.new("../lib/progressbar.rb").each {|line|
+ File.new("lib/progressbar.rb").each {|line|
sleep(SleepUnit)
pbar.inc(line.length)
}
pbar.finish
end
@@ -93,13 +93,23 @@
def test_total_zero
total = 0
pbar = do_make_progress_bar("test(total=0)", total)
pbar.finish
end
+
+ def test_custom_bar_mark
+ total = 100
+ pbar = do_make_progress_bar("test(custom)", total)
+ pbar.bar_mark = '='
+ total.times {
+ sleep(SleepUnit)
+ pbar.inc
+ }
+ pbar.finish
+ end
end
class ReversedProgressBarTest < ProgressBarTest
def do_make_progress_bar (title, total)
ReversedProgressBar.new(title, total)
end
end
-