Module: Insist::Assert

Included in:
Insist, Comparators, Enumerables, Predicates
Defined in:
lib/insist/assert.rb

Instance Method Summary collapse

Instance Method Details

#assert(truthy, message) ⇒ Object

Assert something is true.

This will raise Insist::Failure with the given message if the ‘truthy’ value is false.

Raises:



7
8
9
# File 'lib/insist/assert.rb', line 7

def assert(truthy, message)
  raise Insist::Failure.new(message) if !truthy
end