Created
October 6, 2014 12:04
-
-
Save owahab/259adb88b77e6b0881c5 to your computer and use it in GitHub Desktop.
Play Mac OS X Sounds for Rspec Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run using the command: | |
# rspec -c --require PATH_TO/sound.rb --format Sound --format documentation | |
class Sound | |
RSpec::Core::Formatters.register self, :example_failed | |
RSpec::Core::Formatters.register self, :example_passed | |
def initialize(output) | |
@output = output | |
end | |
def example_passed(notification) | |
`afplay /System/Library/Sounds/Bottle.aiff` | |
end | |
def example_failed(notification) | |
`afplay /System/Library/Sounds/Basso.aiff` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment