Class: ChuckTestar
- Inherits:
-
RSpec::Core::Formatters::BaseTextFormatter
- Object
- RSpec::Core::Formatters::BaseTextFormatter
- ChuckTestar
- Defined in:
- lib/chuck_testar.rb
Instance Method Summary collapse
- #example_failed(example) ⇒ Object
- #example_passed(example) ⇒ Object
- #example_pending(example) ⇒ Object
- #icon(name) ⇒ Object
- #start(example_count) ⇒ Object
- #start_dump ⇒ Object
- #stop ⇒ Object
Instance Method Details
#example_failed(example) ⇒ Object
46 47 48 49 |
# File 'lib/chuck_testar.rb', line 46 def example_failed(example) super(example) output.print green('e') end |
#example_passed(example) ⇒ Object
36 37 38 39 |
# File 'lib/chuck_testar.rb', line 36 def example_passed(example) super(example) output.print green('e') end |
#example_pending(example) ⇒ Object
41 42 43 44 |
# File 'lib/chuck_testar.rb', line 41 def example_pending(example) super(example) output.print green('e') end |
#icon(name) ⇒ Object
5 6 7 |
# File 'lib/chuck_testar.rb', line 5 def icon(name) File.join(File.dirname(__FILE__), '../assets', name) end |
#start(example_count) ⇒ Object
9 10 11 12 |
# File 'lib/chuck_testar.rb', line 9 def start(example_count) super(example_count) output.print green('Y') end |
#start_dump ⇒ Object
51 52 53 54 |
# File 'lib/chuck_testar.rb', line 51 def start_dump super() output.puts end |
#stop ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/chuck_testar.rb', line 14 def stop output.print green('p') output.print green("\n\nYour tests pass!\n") GrowlNotify.normal({ :title => 'RSpec', :description => 'Your tests pass', :icon => icon('chuck-normal.png') }) `say 'Your tests pass!'` sleep(2) if @failed_examples.length > 0 output.print magenta("\n\nNope! It's just Chuck Testa!") GrowlNotify.high({ :title => 'RSpec', :description => 'Nope! It\'s just Chuck Testa!', :icon => icon('chuck-nope.png') }) `say "Nope! It's just Chuck Testa!"` sleep(1) end end |