From: Eric Sven Ristad Date: 2001-02-27T12:55:16+09:00 Subject: [ruby-talk:11647] assert() library in Ruby? How can I achieve the effect of the assert() macro from C in Ruby? In particular, 1. assert() will print something like "Assertion failed: , file , line " only when evaluates to false, where and refer to the location of the assert() call rather than the location of the assert() definition 2. all asserts are ignored if !$DEBUG, ie., assert() does not even evaluate when !$DEBUG The assert() library is extremely useful in building reliable C code, and it would be nice to have some similar capability in Ruby. Thanks, Eric