Skip to content

Instantly share code, notes, and snippets.

@owahab
Created October 6, 2014 12:04
Show Gist options
  • Save owahab/259adb88b77e6b0881c5 to your computer and use it in GitHub Desktop.
Save owahab/259adb88b77e6b0881c5 to your computer and use it in GitHub Desktop.
Play Mac OS X Sounds for Rspec Examples
# 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