Project

General

Profile

Actions

Feature #14925

open

Kernel#assert(expression)

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

Status:
Open
Priority:
Normal
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