Assert
require 'binding_of_caller'
def assert(cond)
puts 'row [%s] / FAIL! [%s]' % [caller[-1].split(':')[1], cond] \
unless eval(cond, binding.of_caller(1))
end
namn = 'holger'
assert %(namn == 'hulken') # => row [9] / FAIL! [namn == 'hulken']
assert %(namn == 'holger') # =>
Install gem with:
gem install binding_of_caller