Guest User

Untitled

a guest
Jul 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. # -*- encoding: utf-8 -*-
  2.  
  3. # $ cat spec/spec.opts
  4. # --require ~/lib/supermario_progress_bar_formatter.rb
  5. # --format Spec::Runner::Formatter::SuperMarioProgressBarFormatter
  6.  
  7. require 'spec/runner/formatter/base_text_formatter'
  8. require 'spec/runner/formatter/no_op_method_missing'
  9.  
  10. module Spec::Runner::Formatter
  11. class SuperMarioProgressBarFormatter < BaseTextFormatter
  12. include NOOPMethodMissing
  13.  
  14. def example_failed(example, counter, failure)
  15. @output.print colorize_failure('☠', failure)
  16. @output.flush
  17. end
  18.  
  19. def example_passed(example)
  20. @output.print green('$')
  21. @output.flush
  22. end
  23.  
  24. def example_pending(example, message, deprecated_pending_location=nil)
  25. super
  26. @output.print yellow('▓')
  27. @output.flush
  28. end
  29.  
  30. def start_dump
  31. @output.puts
  32. @output.flush
  33. end
  34. end
  35. end
Add Comment
Please, Sign In to add comment