Sha256: 452ac4aec9edb98b5987768c2219ad97293b7fe90fd8f66b27adbc98b87f3a5c

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

module RSpec
  module TestSpec
    module Reporter
      # An RSpec reporter sends notifications to listeners. The listeners
      # are usually formatters for a specific test run.
      def example_step_started(example, type, message, options)
        notify :example_step_started,
          Notification.new(example, type, message, options)
      end

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

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

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
test_spec-1.1.0 lib/test_spec/rspec/reporter.rb
test_spec-1.0.0 lib/test_spec/rspec/reporter.rb
test_spec-0.1.0 lib/test_spec/rspec/reporter.rb