Skip to content

Instantly share code, notes, and snippets.

@riethmayer
Created January 20, 2010 19:23
Show Gist options
  • Save riethmayer/282133 to your computer and use it in GitHub Desktop.
Save riethmayer/282133 to your computer and use it in GitHub Desktop.
use assert for design by contract
# 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