Class: RSpec::Core::Notifications::ExamplesNotification

Inherits:
Object
  • Object
show all
Defined in:
opal/opal/rspec/fixes/rspec/core/notifications/examples_notification.rb

Instance Method Summary collapse

Instance Method Details

#fully_formatted_failed_examples(colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'opal/opal/rspec/fixes/rspec/core/notifications/examples_notification.rb', line 3

def fully_formatted_failed_examples(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
  formatted = "\nFailures:\n"

  failure_notifications.each_with_index do |failure, index|
    # string mutation
    formatted = formatted + failure.fully_formatted(index.next, colorizer)
  end

  formatted
end

#fully_formatted_pending_examples(colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'opal/opal/rspec/fixes/rspec/core/notifications/examples_notification.rb', line 14

def fully_formatted_pending_examples(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
  formatted = "\nPending:\n"

  pending_examples.each do |example|
    formatted_caller = RSpec.configuration.backtrace_formatter.backtrace_line(example.location)

    # string mutation
    formatted = formatted +
      "  #{colorizer.wrap(example.full_description, :pending)}\n" \
      "    # #{colorizer.wrap(example.execution_result.pending_message, :detail)}\n" \
      "    # #{colorizer.wrap(formatted_caller, :detail)}\n"
  end

  formatted
end