Project

General

Profile

Actions

Feature #14925

open

Kernel#assert(expression)

Added by Anonymous over 6 years ago. Updated over 6 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:88019]

Description

Sometimes, you want to quickly test your code, but it's overkill to reach for a unit test library.

So could it be useful to add this method to Ruby?

def assert(expression)
  expression or raise AssertionError, 'assertion failed', caller
end

Actions

Also available in: Atom PDF

Like0
Like0