Skip to content

Instantly share code, notes, and snippets.

@leandroh
Last active March 16, 2017 19:58
Show Gist options
  • Save leandroh/802fe94cb27dc17afc206032b8d00b77 to your computer and use it in GitHub Desktop.
Save leandroh/802fe94cb27dc17afc206032b8d00b77 to your computer and use it in GitHub Desktop.
assert_errooo is an assert extension of Minitest::Assertions (inspired by tv presenter Faustão)
exit unless `which mpg123` && $?.success?
require 'minitest'
require 'minitest/autorun'
require 'minitest/pride'
module Minitest::Assertions
def assert_errooo(col, value, msg = nil)
assert col == value, call_errooo(msg)
end
private
def call_errooo(msg)
spawn('mpg123 -q faustao-errou.mp3')
msg
end
end
################################################################################
describe 'assert_errooo' do
it 'emits a sound when it fails' do
assert_errooo(true, false, 'Your error message goes here')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment