Full stracktrace in ruby 1.9

I’m getting stacktraces like:

expected Foo, got #<NoMethodError: undefined method bar=' for nil:NilClass> spec/models/foobar_spec.rb:79:inblock (6 levels) in <top (required)>’

but it would be way more useful to get the 6 levels. How to enable that
globally?

Freak G. wrote:

I’m getting stacktraces like:

expected Foo, got #<NoMethodError: undefined method bar=' for nil:NilClass> spec/models/foobar_spec.rb:79:inblock (6 levels) in <top (required)>’

but it would be way more useful to get the 6 levels. How to enable that
globally?

add this somewhere:

at_exit {
puts “==== "
puts $!.backtrace.join(”\n")
puts “====”
}

Though there are other options [1]

http://github.com/rogerdpack/ruby_backtracer/blob/master/backtrace_nothing_swallowed.rb

On 25.09.2009 16:40, Roger P. wrote:

add this somewhere:
http://github.com/rogerdpack/ruby_backtracer/blob/master/backtrace_nothing_swallowed.rb
You could simply wrap the whole script or the offending region in begin
rescue.

robert