Created
January 20, 2010 19:23
-
-
Save riethmayer/282133 to your computer and use it in GitHub Desktop.
use assert for design by contract
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
# Assertion Method | |
def assert(value, message="Assertion failed") | |
raise Exception, message, caller unless value | |
end | |
options[:cowfile] and | |
assert(options[:cowfile].to_s !~ /^\s*$/) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment