Class: RspecKungFuHamster
- Inherits:
-
RSpec::Core::Formatters::BaseTextFormatter
- Object
- RSpec::Core::Formatters::BaseTextFormatter
- RspecKungFuHamster
- Defined in:
- lib/rspec_kung_fu_hamster.rb
Constant Summary collapse
- KUNG_FU_HAMSTER =
[ [ " ()__() ", " / o o\\ | ", " |' =Y=';-| ", " { \\ / } ", " mmm mmm " ],[ " ()__() ", " / o o\\ ; ", " |' =Y=';-/ ", " { \\ / } ", " mmm mmm " ],[ " ()__() ", " / o o\\ ", " |' =Y=';----", " { \\ / } ", " mmm mmm " ],[ " ()__() ", " / o o\\ ", " |' =Y=';-\\ ", " { \\ / } \\ ", " mmm mmm " ],[ " ()__() ", " / o o\\ ", " |' =Y=';----", " { \\ / } ", " mmm mmm " ],[ " ()__() ", " / o o\\ \\ ", " |' =Y=';-\\ ", " { \\ / } ", " mmm mmm " ]]
- DEAD_HAMSTER =
[ " ()__() ", " / X X\\ | ", " |' =Y=';-| ", " { \\ / } ", " mmm mmm " ]
Instance Method Summary collapse
- #example_failed(notification) ⇒ Object
- #example_passed(notification) ⇒ Object
- #hamster_and_next ⇒ Object
-
#initialize(output) ⇒ RspecKungFuHamster
constructor
:dump_failures.
Constructor Details
#initialize(output) ⇒ RspecKungFuHamster
:dump_failures
16 17 18 19 |
# File 'lib/rspec_kung_fu_hamster.rb', line 16 def initialize(output) @index = 0 super(output) end |
Instance Method Details
#example_failed(notification) ⇒ Object
24 25 26 27 |
# File 'lib/rspec_kung_fu_hamster.rb', line 24 def example_failed(notification) output.puts "\e[2J\e[;H" << hamster_and_next.join("\n") sleep 0.1 end |
#example_passed(notification) ⇒ Object
21 22 23 |
# File 'lib/rspec_kung_fu_hamster.rb', line 21 def example_passed(notification) output.puts "\e[2J\e[;H" << hamster_and_next.join("\n") end |
#hamster_and_next ⇒ Object
29 30 31 |
# File 'lib/rspec_kung_fu_hamster.rb', line 29 def hamster_and_next KUNG_FU_HAMSTER[@index % KUNG_FU_HAMSTER.length].tap { @index += 1 } end |