# Odd unit test error

**URL:** <https://www.ruby-forum.com/t/odd-unit-test-error/151456>\
**Category:** Ruby\
**Created:** [October 21, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/odd-unit-test-error/151456 "2008-10-21T20:58:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenneth\_McDonald](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Post date:** [October 21, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/odd-unit-test-error/151456/1 "2008-10-21T20:58:45Z")

</div>

On one of my unit test errors, I’m getting the error message:

NameError: uncaught throw ‘invalid\_test’

It’s the part about “uncaught throw ‘invalid\_test’” that I don’t get.  
That sounds like an error from the unit test framework itself. Can  
anyone shed any light on what this means?

Thanks,  
Ken

---

<div class="post-metadata">

**Author:** ![Kenneth\_McDonald](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Post date:** [October 21, 2008, 11:21pm UTC](https://www.ruby-forum.com/t/odd-unit-test-error/151456/2 "2008-10-21T23:21:04Z")

</div>

Kenneth McDonald wrote:

> On one of my unit test errors, I’m getting the error message:
> 
> NameError: uncaught throw ‘invalid\_test’
> 
> It’s the part about “uncaught throw ‘invalid\_test’” that I don’t get.  
> That sounds like an error from the unit test framework itself. Can  
> anyone shed any light on what this means?

Can you post the whole backtrace? And what code causes this error?

The only instance of it I can see in the source is test/unit/testcase.rb  
line 43, which looks like either you’re trying to invoke a test which  
doesn’t exist, or you’re invoking a test with invalid arity like

def test\_foo(x)  
…  
end

But normally the framework would never try to invoke such a method  
anyway, so it’s strange.

You could try running with ruby -w, might give you some more clues.
