Sha256: 4b51f09c75b5afb7a298edf5866f95b7a9e8c4bb923b2f8c630129334e9c080f

Contents?: true

Size: 819 Bytes

Versions: 22

Compression:

Stored size: 819 Bytes

Contents

require 'lib/ramaze/spec/helper/snippets'

describe "Ramaze#caller_info" do
  before do
    @file = File.expand_path(File.join(File.dirname(__FILE__), '../../../lib/ramaze/gestalt.rb'))
  end

  it 'should show  line numbers' do
   res = Ramaze.caller_lines(@file, 68, 2)
   res.size.should == 5
   res.map{|e| e[0]}.should == (66..70).to_a
  end

  it 'should show which line we asked for' do
   res = Ramaze.caller_lines(@file, 68, 2)
   res.size.should == 5
   res.map {|e| e[2]}.should == [false,false,true,false,false]
  end

  it 'should show the code' do
   res = Ramaze.caller_lines(__FILE__, __LINE__, 1)
   res.size.should == 3
   res.map {|e| e[1].strip}.should == [
      "it 'should show the code' do",
      "res = Ramaze.caller_lines(__FILE__, __LINE__, 1)",
      "res.size.should == 3"
   ]
  end

end

Version data entries

22 entries across 22 versions & 5 rubygems

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