Class: RspecDispatch::Formatter
- Inherits:
-
RSpec::Core::Formatters::ProgressFormatter
- Object
- RSpec::Core::Formatters::ProgressFormatter
- RspecDispatch::Formatter
- Defined in:
- lib/rspec_dispatch/formatter.rb
Instance Method Summary collapse
- #dump_summary(examples) ⇒ Object
- #example_failed(notification) ⇒ Object
- #example_passed(notification) ⇒ Object
- #example_pending(notification) ⇒ Object
- #start(example_count) ⇒ Object
- #start_dump(notification) ⇒ Object
Instance Method Details
#dump_summary(examples) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/rspec_dispatch/formatter.rb', line 35 def dump_summary(examples) rspec_data = { duration: examples.duration, example_count: examples.example_count, success_count: examples.example_count.to_i - examples.failure_count.to_i - examples.pending_count.to_i, failure_count: examples.failure_count, pending_count: examples.pending_count } report = RspecDispatch::Report.new(rspec_data) report.monitor_data = @monitor report.deliver super(examples) end |
#example_failed(notification) ⇒ Object
25 26 27 28 |
# File 'lib/rspec_dispatch/formatter.rb', line 25 def example_failed(notification) @monitor.track notification.example super(notification) end |
#example_passed(notification) ⇒ Object
15 16 17 18 |
# File 'lib/rspec_dispatch/formatter.rb', line 15 def example_passed(notification) @monitor.track notification.example super(notification) end |
#example_pending(notification) ⇒ Object
20 21 22 23 |
# File 'lib/rspec_dispatch/formatter.rb', line 20 def example_pending(notification) @monitor.track notification.example super(notification) end |
#start(example_count) ⇒ Object
11 12 13 |
# File 'lib/rspec_dispatch/formatter.rb', line 11 def start(example_count) @monitor = RspecDispatch::Monitor.new end |
#start_dump(notification) ⇒ Object
30 31 32 33 |
# File 'lib/rspec_dispatch/formatter.rb', line 30 def start_dump(notification) super(notification) output.puts end |