Skip to content

Instantly share code, notes, and snippets.

@unicornrainbow
Created February 2, 2011 19:55
Show Gist options
  • Save unicornrainbow/808298 to your computer and use it in GitHub Desktop.
Save unicornrainbow/808298 to your computer and use it in GitHub Desktop.
Negating assertions
def assert_not(test, msg = (nomsg = true; nil))
nomsg ? assert(!test) : assert(!test, msg)
end
@unicornrainbow
Copy link
Author

This is a nice little diddy, but totally not needed thanks to minitest. Just use refute.

refute false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment