Skip to content

Instantly share code, notes, and snippets.

@shyam-habarakada
Created July 3, 2014 23:04
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 shyam-habarakada/545bf49b9423ac2f228b to your computer and use it in GitHub Desktop.
Save shyam-habarakada/545bf49b9423ac2f228b to your computer and use it in GitHub Desktop.
A simple rails assert method
def assert(message = 'assertion failed')
unless block_given? and yield
if Rails.env.development? or Rails.env.test?
raise message
else
Rails.logger.warn "(assert) #{message}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment