Sha256: 9afbbff678c22dda695564e1d3c599b3c7c9bc58372dc0a15ae3c687d8c97456

Contents?: true

Size: 381 Bytes

Versions: 1

Compression:

Stored size: 381 Bytes

Contents

module NanoTest
  extend self

  FAILURES = []

  def assert(msg="assertion failed",file=nil,line=nil,&block)
    if block.call == false
      file ||= caller.first.split(':')[0]
      line ||= caller.first.split(':')[1]
      FAILURES << "(%s:%0.3d) %s" % [file,line,msg]
      print 'F'
    else
      print '.'
    end
  end

  at_exit { puts; FAILURES.each {|f| puts f } }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nanotest-0.9.1 lib/nanotest.rb