lilingjay lilingjay - 6 months ago 19
Ruby Question

How to get the current testcase name in test-unit?

example:

def setup
end

def teardown
end


How do I get the current case name in the setup method?

Answer

In Ruby 1.9.3, you can do something like this:

def setup
  puts self.__name__
end