assert_not

assert_not(object, message = nil)
Instance Public methods

Assert that an expression is not truthy. Passes if object is nil or false. âTruthyâ means âconsidered true in a conditionalâ like if foo.

1
2
3
assert_not nil    # => true
assert_not false  # => true
assert_not 'foo'  # => 'foo' is not nil or false

An error message can be specified.

1
assert_not foo, 'foo should be false'
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.