# How do I register a custom runner for Test::Unit?

**URL:** <https://www.ruby-forum.com/t/how-do-i-register-a-custom-runner-for-test-unit/120838>\
**Category:** Ruby\
**Created:** [November 21, 2007, 12:05am UTC](https://www.ruby-forum.com/t/how-do-i-register-a-custom-runner-for-test-unit/120838 "2007-11-21T00:05:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![epasquier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/2bfe46/32.png) [@epasquier](https://www.ruby-forum.com/u/epasquier)\
**Post date:** [November 21, 2007, 12:05am UTC](https://www.ruby-forum.com/t/how-do-i-register-a-custom-runner-for-test-unit/120838/1 "2007-11-21T00:05:42Z")

</div>

Three years ago in [http://tinyurl.com/2xkvrl](http://tinyurl.com/2xkvrl)  
([http://groups.google.com/group/comp.lang.ruby/browse\_frm/thread/](http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/)  
5df4ed2c27d59326/d69077b7759fe4bf?hl=en&lnk=st&q=ruby+test+custom  
+runner+group%3Acomp.lang.ruby#d69077b7759fe4bf)  
someone asked Nathaniel how he could register his custom test runner  
without hacking the list of RUNNERS in test/unit/autorunner.rb

Nathaniel’s answer was to use an explicit call, as in:

MyRunner.run(MySuite)

This still seems to be the case. I would like to invoke rake with the  
TESTOPTS env var pointing to my custom runner. Is there a way to get  
around both having my customers manually hack autorunner.rb (or  
supplying them with a script to do that, which is probably no better),  
while still using Rake’s ability to discover the tests, build the test  
suite, fire the runner, and return the results?

I’m trying to avoid reinventing as many wheels as possible here.

Thanks,  
Eric P.
