Sha256: d035dc1d08fffdc1cb2458090dd6ef3503e23f924e2fdfa7e5373e8953aba621
Contents?: true
Size: 624 Bytes
Versions: 1
Compression:
Stored size: 624 Bytes
Contents
require 'nano/binding/eval' class Binding # Returns the call stack, same format as Kernel#caller() def caller( skip = 0 ) eval( "caller( #{skip} )" ) end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCBinding < Test::Unit::TestCase def setup a = 1 b = 2 x = "hello" # the line number must be updated if it moves @bind = binding; @this_line_no = 25 end def test_caller # how to test? assert_nothing_raised{ @bind.caller } end end =end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
facets-0.9.0 | lib/nano/binding/caller.rb |