Last active
March 16, 2017 19:58
-
-
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)
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
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