Permalink
Browse files

Add a 1.8.x-compatible hack to get the current method name

  • Loading branch information...
1 parent e13d95b commit ed4176db5f9eafeb98b65f004c1355288fc1f1fa Lawrence Wang committed with Jan 9, 2012
Showing with 6 additions and 1 deletion.
  1. +5 −0 lib/minitest/reporter.rb
  2. +1 −1 lib/minitest/reporters/default_reporter.rb
View
@@ -29,5 +29,10 @@ def pass(suite, test, test_runner); end
def skip(suite, test, test_runner); end
def failure(suite, test, test_runner); end
def error(suite, test, test_runner); end
+
+ def current_method
+ caller[0] =~ /`(.*?)'/
+ $1
+ end
end
end
@@ -17,7 +17,7 @@ def before_suites(suites, type)
end
def before_test(suite, test)
- print "#{suite}##{method} = " if verbose?
+ print "#{suite}##{current_method} = " if verbose?
end
def pass(suite, test, test_runner)

0 comments on commit ed4176d

Please sign in to comment.