Class: Tack::Formatters::ProgressBar

Inherits:
Object
  • Object
show all
Includes:
Middleware
Defined in:
lib/tack/formatters/progress_bar.rb

Instance Method Summary collapse

Methods included from Middleware

#returning

Constructor Details

#initialize(app) ⇒ ProgressBar

Returns a new instance of ProgressBar.



8
9
10
# File 'lib/tack/formatters/progress_bar.rb', line 8

def initialize(app)
  @app = app
end

Instance Method Details

#run_suite(tests) ⇒ Object



12
13
14
15
16
# File 'lib/tack/formatters/progress_bar.rb', line 12

def run_suite(tests)
  returning @app.run_suite(tests) do 
    puts
  end
end

#run_test(file, description) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/tack/formatters/progress_bar.rb', line 18

def run_test(file, description)
  returning @app.run_test(file, description) do |result|
    result[:passed].each do
      print "."
    end
    result[:pending].each do
      print "P"
    end
    result[:failed].each do
      print "F"
    end
  end
end