Sha256: 9c28b908af86a9db914cb11df9ddf85dae1fcf216b9294cd914b7c75702d9c8c
Contents?: true
Size: 519 Bytes
Versions: 1
Compression:
Stored size: 519 Bytes
Contents
module Freeman VERSION = "0.0.3" end module Kernel def test(description, &block) KFTest.new(description, block).run end end class Object def is(expected) self == expected end def isnt(expected) self != expected end end KFTest = Struct.new(:description, :block) do def run status = block.call ? true : false puts "#{ description }: #{ status }" if status.is false line = block.source_location.join(": ") puts " from #{ line }" end return status end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
freeman-0.0.3 | lib/freeman.rb |