File: helper.rb

package info (click to toggle)
ruby-power-assert 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 220 kB
  • sloc: ruby: 1,462; makefile: 5; sh: 4
file content (8 lines) | stat: -rw-r--r-- 273 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
require 'benchmark/ips'
require 'power_assert'

def assertion_message(source = nil, source_binding = TOPLEVEL_BINDING, &blk)
  ::PowerAssert.start(source || blk, assertion_method: __callee__, source_binding: source_binding) do |pa|
    pa.message unless pa.yield
  end
end