method

assert_block

v1_9_3_125 - Show latest stable - Class: Test::Unit::Assertions
assert_block(*msgs)
public

Tests the result of the given block. If the block does not return true, the assertion will fail. The optional failure_message argument is the same as in Assertions#assert.

assert_block do
  [1, 2, 3].any? { |num| num < 1 }
end