Assit. Runtime assertions for Ruby.
Assit is a small, lightweight plugin providing runtime assertions for Ruby. With asiit you can:
- Easily place assertions anywhere in your code
- Select the action that will be taken if an assertion fails
- Disable the assertions to remove the overhead
Currently this page contains only some general information, so that the rubyforge project page is not completely dead. Check the RDoc for now for more instructions. (Note that the RDocs linked above are created from the curren development version.
Getting started is dead easy: Just install the gem and require 'assit'. Then you're good to go. You will be able to use methods like #assit() or #assit_equals() in your code.
You can also configure the action that will be taken on a failed assertion, or disable all assertions. Check the documentation of the Config module for more info.