#961: MacRuby trunk doesn't show the correct file and line numbers in stacktraces involving blocks --------------------------------+------------------------------------------- Reporter: manfred@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Running the following code in MacRuby: {{{ require 'rubygems' require 'bacon' Bacon.extend Bacon::TestUnitOutput Bacon.summary_on_exit describe "Something" do it "fails" do raise 'foo' end end }}} shows the following stacktrace: {{{ lsof% macruby t.rb E RuntimeError: foo /Library/Frameworks/MacRuby.framework/Versions/0.8/usr/lib/ruby/Gems/1.9.2/gems/bacon-1.1.0/lib/bacon.rb:in `handle_requirement:': Something - fails /Users/manfred/Code/t.rb:8:in `block' /Users/manfred/Code/t.rb:7:in `<main>' 1 tests, 0 assertions, 0 failures, 1 errors }}} Ruby 1.9.2 shows line numbers and the fact that the code is run from a block in it's stacktrace, which is a lot more informative: {{{ lsof% /opt/ruby-1.9.2/bin/ruby t.rb E RuntimeError: foo t.rb:9:in `block (2 levels) in <main>': Something - fails t.rb:8:in `block in <main>' t.rb:7:in `<main>' 1 tests, 0 assertions, 0 failures, 1 errors }}} This means that you can only identify the top level block in which the error occurred, which is usually not enough because it's basically the complete testcase. -- Ticket URL: <http://www.macruby.org/trac/ticket/961> MacRuby <http://macruby.org/>