File: assert.rb

package info (click to toggle)
ruby-insist 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 204 kB
  • sloc: ruby: 378; makefile: 40; sh: 10
file content (10 lines) | stat: -rw-r--r-- 279 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10

module Insist::Assert
  # Assert something is true.
  #
  # This will raise Insist::Failure with the given message if the 'truthy'
  # value is false.
  def assert(truthy, message)
    raise Insist::Failure.new(message) if !truthy
  end # def assert
end # module Insist::Assert