Sha256: f367d56b8a7d6cb2b358ca2d7a96818bdfdef6b556cebf5e459e68768886c125

Contents?: true

Size: 366 Bytes

Versions: 2

Compression:

Stored size: 366 Bytes

Contents

require 'facets/binding'

module Kernel
  alias_method :assert, :binding
end

class Binding
  
  def / expression
    if not eval expression
      the_caller = /\`([^\']+)\'/.match(caller(0).first)
      m = "unknown"
      m = the_caller ? the_caller[1] : m
      raise "Assertion '#{expression}' not satisfied in #{self.self()}##{m}"
    end
    self
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
clean_assert-1.2.0 lib/clean_assert.rb
clean_assert-1.1.2 lib/clean_assert.rb