Class: RSpec::Longrun::Formatter
- Inherits:
-
Core::Formatters::BaseTextFormatter
- Object
- Core::Formatters::BaseTextFormatter
- RSpec::Longrun::Formatter
- Defined in:
- lib/rspec/longrun/formatter.rb
Defined Under Namespace
Classes: Block
Instance Method Summary collapse
- #example_failed(notification) ⇒ Object
- #example_group_finished(notification) ⇒ Object
- #example_group_started(notification) ⇒ Object
- #example_passed(notification) ⇒ Object
- #example_pending(notification) ⇒ Object
- #example_started(notification) ⇒ Object
-
#initialize(output) ⇒ Formatter
constructor
A new instance of Formatter.
- #start(notification) ⇒ Object
- #step_failed ⇒ Object
- #step_finished ⇒ Object
- #step_pending ⇒ Object
- #step_started(description) ⇒ Object
Constructor Details
#initialize(output) ⇒ Formatter
Returns a new instance of Formatter.
14 15 16 17 |
# File 'lib/rspec/longrun/formatter.rb', line 14 def initialize(output) super(output) @blocks = [Block.new(true)] end |
Instance Method Details
#example_failed(notification) ⇒ Object
43 44 45 |
# File 'lib/rspec/longrun/formatter.rb', line 43 def example_failed(notification) end_block(wrap("FAILED", :failure)) end |
#example_group_finished(notification) ⇒ Object
27 28 29 |
# File 'lib/rspec/longrun/formatter.rb', line 27 def example_group_finished(notification) end_block end |
#example_group_started(notification) ⇒ Object
23 24 25 |
# File 'lib/rspec/longrun/formatter.rb', line 23 def example_group_started(notification) begin_block(notification.group.description) end |
#example_passed(notification) ⇒ Object
35 36 37 |
# File 'lib/rspec/longrun/formatter.rb', line 35 def example_passed(notification) end_block(wrap("OK", :success)) end |
#example_pending(notification) ⇒ Object
39 40 41 |
# File 'lib/rspec/longrun/formatter.rb', line 39 def example_pending(notification) end_block(wrap("PENDING: " + notification.example.execution_result., :pending)) end |
#example_started(notification) ⇒ Object
31 32 33 |
# File 'lib/rspec/longrun/formatter.rb', line 31 def example_started(notification) begin_block(wrap(notification.example.description, :detail)) end |
#start(notification) ⇒ Object
19 20 21 |
# File 'lib/rspec/longrun/formatter.rb', line 19 def start(notification) Thread.current["rspec.longrun.formatter"] = self end |
#step_failed ⇒ Object
55 56 57 |
# File 'lib/rspec/longrun/formatter.rb', line 55 def step_failed end_block(wrap("✗", :failure)) end |
#step_finished ⇒ Object
51 52 53 |
# File 'lib/rspec/longrun/formatter.rb', line 51 def step_finished end_block(wrap("✓", :success)) end |
#step_pending ⇒ Object
59 60 61 |
# File 'lib/rspec/longrun/formatter.rb', line 59 def step_pending end_block(wrap("PENDING", :pending)) end |
#step_started(description) ⇒ Object
47 48 49 |
# File 'lib/rspec/longrun/formatter.rb', line 47 def step_started(description) begin_block(description) end |