Properly suppressing output and testing progress bar

This commit is contained in:
Andy Meneely
2014-08-05 22:51:43 -04:00
parent 6c31320411
commit f9c572116d
4 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -6,7 +6,9 @@ module Squib
# @api private
class DoNothing
def increment
#do nothing!
end
def finish
end
end
@@ -22,7 +24,7 @@ module Squib
end
def start(title="", total=100, &block)
if @enabled && !(ENV['IN_TEST'].eql? "true")
if @enabled
@bar = ProgressBar.create(title: title, total: total, format: '%t <%B> %p%% %a')
yield(@bar)
@bar.finish