Module: RSpec::TestSpec::Reporter

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

Instance Method Summary collapse

Instance Method Details

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



16
17
18
19
# File 'lib/test_spec/rspec/reporter.rb', line 16

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



11
12
13
14
# File 'lib/test_spec/rspec/reporter.rb', line 11

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



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

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
9
# File 'lib/test_spec/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



30
31
32
# File 'lib/test_spec/rspec/reporter.rb', line 30

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

#registered_formattersObject



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

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