#5 new
Tammer Saleh

Munge backtrace to show where the macro was called from.

Reported by Tammer Saleh | December 7th, 2007 @ 11:10 AM | in 4.0

Something like this:

require 'test/unit'

class StupidTest < Test::Unit::TestCase
  
  def self.should_whatever
    file, line = caller(0)[1].split(':')
    class_eval "def test_should_whatever; assert false; end", file, line.to_i
  end
  
  should_whatever
  
end

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket