Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Import initial code

  • Loading branch information...
commit c610ec4c2f744847fc69de321b3b03fe79e7f677 0 parents
@gregbell authored
24 lib/spec_music_formatter.rb
@@ -0,0 +1,24 @@
+require 'spec/runner/formatter/progress_bar_formatter'
+
+
+class SpecMusicFormatter < Spec::Runner::Formatter::ProgressBarFormatter
+
+ SOUNDS_PATH = File.expand_path("#{File.dirname(__FILE__)}/../sounds")
+ puts SOUNDS_PATH
+
+ def example_failed(example, counter, failure)
+ super
+ end
+
+ def example_passed(example)
+ @count ||= 0
+ system("/usr/bin/afplay #{SOUNDS_PATH}/#{@count % 3}.aif")
+ super
+ @count += 1
+ end
+
+ def example_pending(example, message, deprecated_pending_location=nil)
+ super
+ end
+
+end
BIN  sounds/0.aif
Binary file not shown
BIN  sounds/1.aif
Binary file not shown
BIN  sounds/2.aif
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.