Skip to content

Instantly share code, notes, and snippets.

@wvanbergen
Created October 7, 2009 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvanbergen/204134 to your computer and use it in GitHub Desktop.
Save wvanbergen/204134 to your computer and use it in GitHub Desktop.
Audio-enabled, profanity-enabled unit testing
module Swearing
SWEAR_WORDS = ['dammit', 'fuck', 'son of a bitch', 'motherfucker', 'oh no', 'prick']
SWEAR_VOICE = 'Alex'
def self.swear!
`say -v #{SWEAR_VOICE} #{SWEAR_WORDS[rand(SWEAR_WORDS.length)]} &`
end
end
class Test::Unit::Error
def single_character_display
Swearing.swear!
return 'E'
end
end
class Test::Unit::Failure
def single_character_display
Swearing.swear!
return 'F'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment