Module: RSpec::Proverbs::Reporter

Defined in:
lib/proverbs/rspec/reporter.rb

Instance Method Summary collapse

Instance Method Details

#example_step_failed(example, type, message, options) ⇒ Object



14
15
16
# File 'lib/proverbs/rspec/reporter.rb', line 14

def example_step_failed(example, type, message, options)
  notify :example_step_failed, Notification.new(example, type, message, options)
end

#example_step_passed(example, type, message, options) ⇒ Object



10
11
12
# File 'lib/proverbs/rspec/reporter.rb', line 10

def example_step_passed(example, type, message, options)
  notify :example_step_passed, Notification.new(example, type, message, options)
end

#example_step_pending(example, type, message, options) ⇒ Object



18
19
20
# File 'lib/proverbs/rspec/reporter.rb', line 18

def example_step_pending(example, type, message, options)
  notify :example_step_pending, Notification.new(example, type, message, options)
end

#example_step_started(example, type, message, options) ⇒ Object

An RSpec reporter sends notifications to listeners. The listeners are usually formatters for a specific test run.



6
7
8
# File 'lib/proverbs/rspec/reporter.rb', line 6

def example_step_started(example, type, message, options)
  notify :example_step_started, Notification.new(example, type, message, options)
end

#find_registered_formatter(cls) ⇒ Object



26
27
28
# File 'lib/proverbs/rspec/reporter.rb', line 26

def find_registered_formatter(cls)
  registered_formatters.detect { |formatter| formatter.class == cls }
end

#registered_formattersObject



22
23
24
# File 'lib/proverbs/rspec/reporter.rb', line 22

def registered_formatters
  @listeners.values.map(&:to_a).flatten.uniq
end