Class: Spec::Runner::Formatter::InstantDisappointmentFormatter
- Inherits:
-
ProgressBarFormatter
- Object
- ProgressBarFormatter
- Spec::Runner::Formatter::InstantDisappointmentFormatter
- Defined in:
- lib/instant_disappointment_formatter.rb
Constant Summary collapse
- VERSION =
"1.1.0"
- SHOW_TOP =
(ENV['PROFILE_SHOW_TOP'] || 20).to_i
Instance Method Summary collapse
- #dump_failure(counter, failure) ⇒ Object
- #dump_failure_without_lockout ⇒ Object
- #example_failed(example, counter, failure) ⇒ Object
- #example_failed_without_instant_disappointment ⇒ Object
- #example_passed(example) ⇒ Object
- #example_started(*args) ⇒ Object
-
#initialize(*args) ⇒ InstantDisappointmentFormatter
constructor
A new instance of InstantDisappointmentFormatter.
- #start_dump ⇒ Object
Constructor Details
#initialize(*args) ⇒ InstantDisappointmentFormatter
Returns a new instance of InstantDisappointmentFormatter.
10 11 12 13 |
# File 'lib/instant_disappointment_formatter.rb', line 10 def initialize(*args) super @example_times = [] end |
Instance Method Details
#dump_failure(counter, failure) ⇒ Object
39 40 41 42 |
# File 'lib/instant_disappointment_formatter.rb', line 39 def dump_failure(counter, failure) return if @in_dump super end |
#dump_failure_without_lockout ⇒ Object
29 |
# File 'lib/instant_disappointment_formatter.rb', line 29 alias :dump_failure_without_lockout :dump_failure |
#example_failed(example, counter, failure) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/instant_disappointment_formatter.rb', line 31 def example_failed(example, counter, failure) example_failed_without_instant_disappointment(example, counter, failure) puts dump_failure(counter, failure) puts output.flush end |
#example_failed_without_instant_disappointment ⇒ Object
28 |
# File 'lib/instant_disappointment_formatter.rb', line 28 alias :example_failed_without_instant_disappointment :example_failed |
#example_passed(example) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/instant_disappointment_formatter.rb', line 19 def example_passed(example) super @example_times << [ example_group.description, example.description, Time.now - @time ] end |
#example_started(*args) ⇒ Object
15 16 17 |
# File 'lib/instant_disappointment_formatter.rb', line 15 def example_started(*args) @time = Time.now end |
#start_dump ⇒ Object
44 45 46 47 48 |
# File 'lib/instant_disappointment_formatter.rb', line 44 def start_dump dump_group_times dump_example_times @in_dump = true end |