Class: Spec::Runner::Formatter::ProgressBarFormatter

Inherits:
BaseTextFormatter show all
Defined in:
lib/spec/runner/formatter/progress_bar_formatter.rb

Instance Method Summary collapse

Methods inherited from BaseTextFormatter

#dump_failure, #dump_summary, #format_backtrace, #initialize, #spec_started, #start

Constructor Details

This class inherits a constructor from Spec::Runner::Formatter::BaseTextFormatter

Instance Method Details

#add_context(name, first) ⇒ Object



5
6
7
8
# File 'lib/spec/runner/formatter/progress_bar_formatter.rb', line 5

def add_context(name, first)
  @output.puts if first
  STDOUT.flush
end

#spec_failed(name, counter, failure) ⇒ Object



10
11
12
13
# File 'lib/spec/runner/formatter/progress_bar_formatter.rb', line 10

def spec_failed(name, counter, failure)
  @output.print failure.expectation_not_met? ? red('F') : magenta('F')
  STDOUT.flush
end

#spec_passed(name) ⇒ Object



15
16
17
18
# File 'lib/spec/runner/formatter/progress_bar_formatter.rb', line 15

def spec_passed(name)
  @output.print green('.')
  STDOUT.flush
end

#start_dumpObject



20
21
22
23
# File 'lib/spec/runner/formatter/progress_bar_formatter.rb', line 20

def start_dump
  @output.puts
  STDOUT.flush
end