Class: FoodFormatter

Inherits:
RSpec::Core::Formatters::ProgressFormatter
  • Object
show all
Defined in:
lib/food_formatter.rb

Instance Method Summary collapse

Instance Method Details

#dump_failures(notification) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/food_formatter.rb', line 28

def dump_failures(notification)
  return if notification.failure_notifications.empty?

  formatted = "\n🄩 🄩 🄩 Failure 🄩 🄩 🄩\n"
  notification.failure_notifications.each_with_index do |failure, index|
    formatted += failure.fully_formatted(index + 1, ::RSpec::Core::Formatters::ConsoleCodes)
  end

  @output.puts(formatted)
end

#dump_pending(notification) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/food_formatter.rb', line 16

def dump_pending(notification)
  return if notification.pending_examples.empty?

  formatted = "\nšŸŗ šŸŗ šŸŗ Pending šŸŗ šŸŗ šŸŗ\n"

  notification.pending_notifications.each_with_index do |pending, index|
    formatted << pending.fully_formatted(index + 1, ::RSpec::Core::Formatters::ConsoleCodes)
  end

  @output.puts(formatted)
end

#dump_summary(summary) ⇒ Object



39
40
41
# File 'lib/food_formatter.rb', line 39

def dump_summary(summary)
  @output.puts(totals_line(summary))
end

#example_failed(_notification) ⇒ Object



12
13
14
# File 'lib/food_formatter.rb', line 12

def example_failed(_notification)
  @output.print(' 🄩 ')
end

#example_passed(_notification) ⇒ Object



4
5
6
# File 'lib/food_formatter.rb', line 4

def example_passed(_notification)
  @output.print(' šŸ„— ')
end

#example_pending(_notification) ⇒ Object



8
9
10
# File 'lib/food_formatter.rb', line 8

def example_pending(_notification)
  @output.print(' šŸŗ ')
end