Sha256: a7e528ab56d4a5930a24cc2d983536ba45c3641caa1fb5d18c214dcdb78b5b1e

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

module TestRocket
  extend Module.new { attr_accessor :out }
  
  def _test(a, b)
    send((call rescue()) ? a : b)
  end

  def +@; r = _test :_pass, :_fail; (TestRocket.out || $>) << r; r end
  def -@; r = _test :_fail, :_pass; (TestRocket.out || $>) << r; r end
  def ~@; r = _pend;                (TestRocket.out || $>) << r; r end
  def !@; r = _desc;                (TestRocket.out || $>) << r; r end
  
  def _pass; "     OK\n"; end
  def _fail; "   FAIL @ #{source_location.join(':')}\n"; end
  def _pend; "PENDING '#{call.to_s}' @ #{source_location.join(':')}\n"; end
  def _desc; "   FIRE '#{call.to_s}'!\n"; end
end

Proc.send :include, TestRocket

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aki-testrocket-0.0.2 lib/testrocket.rb