assert_not_nil(object, message="")
Passes if ! object .nil?
Example:
assert_not_nil '1 two 3'.sub!(/two/, '2')
# File lib/test/unit/assertions.rb, line 358 def assert_not_nil(object, message="") full_message = build_message(message, "<?> expected to not be nil.", object) assert_block(full_message){!object.nil?} end