RSpec::Support.require_rspec_core 'formatters/base_text_formatter'

class BonusFormatter < RSpec::Core::Formatters::DocumentationFormatter
  RSpec::Core::Formatters.register self, :dump_summary

  def dump_summary(notification)
    output.puts BONUS if notification.failure_count.zero?
    super notification
  end
end

# rubocop:disable Layout/LineLength
BONUS = "


 .-----------------. .----------------.   .----------------.  .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. | | .--------------. || .--------------. || .--------------. || .--------------. |
| | ____  _____  | || |     ____     | | | |  _______     | || |      __      | || |  ___  ____   | || |  _________   | |
| ||_   \\|_   _| | || |   .'    `.   | | | | |_   __ \\    | || |     /  \\     | || | |_  ||_  _|  | || | |_   ___  |  | |
| |  |   \\ | |   | || |  /  .--.  \\  | | | |   | |__) |   | || |    / /\\ \\    | || |   | |_/ /    | || |   | |_  \\_|  | |
| |  | |\\ \\| |   | || |  | |    | |  | | | |   |  __ /    | || |   / ____ \\   | || |   |  __'.    | || |   |  _|  _   | |
| | _| |_\\   |_  | || |  \\  `--'  /  | | | |  _| |  \\ \\_  | || | _/ /    \\ \\_ | || |  _| |  \\ \\_  | || |  _| |___/ |  | |
| ||_____|\\____| | || |   `.____.'   | | | | |____| |___| | || ||____|  |____|| || | |____||____| | || | |_________|  | |
| |              | || |              | | | |              | || |              | || |              | || |              | |
| '--------------' || '--------------' | | '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'   '----------------'  '----------------'  '----------------'  '----------------'


"
# rubocop:enable Layout/LineLength
