Sha256: 464a63c6de35c94bcc642f93b63fb5fc6a8c06872e8c14c12de4877dc5493a9d

Contents?: true

Size: 709 Bytes

Versions: 22

Compression:

Stored size: 709 Bytes

Contents

require 'spec/helper'

#TODO test parse_backtrace explicitly
describe "Ramaze#caller_info" do

  def foo(n=0)
    Ramaze.caller_info(n)
  end

  def bar
    foo
  end

  def baz
    foo(1)
  end

  it "should report correct informations" do
    file,line,meth=foo()
    file.should == __FILE__
    line.should.match(/\d+/)
    meth.should == 'foo'
  end

  it "should report correct informations on nested defs" do
    file,line,meth=bar()
    file.should == __FILE__
    line.should.match(/\d+/)
    meth.should == 'foo'
  end

  it "should report correct informations on other callers" do
    file,line,meth=baz()
    file.should == __FILE__
    line.should.match(/\d+/)
    meth.should == 'baz'
  end

end

Version data entries

22 entries across 22 versions & 5 rubygems

Version Path
Pistos-ramaze-2008.09 spec/snippets/ramaze/caller_info.rb
Pistos-ramaze-2008.12 spec/snippets/ramaze/caller_info.rb
Pistos-ramaze-2009.01 spec/snippets/ramaze/caller_info.rb
Pistos-ramaze-2009.02 spec/snippets/ramaze/caller_info.rb
clivecrous-ramaze-0.3.9.5 spec/snippets/ramaze/caller_info.rb
manveru-ramaze-2008.07 spec/snippets/ramaze/caller_info.rb
manveru-ramaze-2008.08 spec/snippets/ramaze/caller_info.rb
manveru-ramaze-2008.09 spec/snippets/ramaze/caller_info.rb
manveru-ramaze-2008.10 spec/snippets/ramaze/caller_info.rb
manveru-ramaze-2008.12 spec/snippets/ramaze/caller_info.rb
manveru-ramaze-2009.01 spec/snippets/ramaze/caller_info.rb
ptomato-ramaze-2009.02.1 spec/snippets/ramaze/caller_info.rb
ptomato-ramaze-2009.02 spec/snippets/ramaze/caller_info.rb
ramaze-0.3.5 spec/snippets/ramaze/caller_info.rb
ramaze-0.3.0 spec/snippets/ramaze/caller_info.rb
ramaze-0.3.9.1 spec/snippets/ramaze/caller_info.rb
ramaze-0.3.9 spec/snippets/ramaze/caller_info.rb
ramaze-2009.01 spec/snippets/ramaze/caller_info.rb
ramaze-2008.06 spec/snippets/ramaze/caller_info.rb
ramaze-2008.11 spec/snippets/ramaze/caller_info.rb