# Test::Unit - "exit" exception/command?

**URL:** <https://www.ruby-forum.com/t/test-unit-exit-exception-command/109503>\
**Category:** Ruby\
**Created:** [July 16, 2007, 2:04am UTC](https://www.ruby-forum.com/t/test-unit-exit-exception-command/109503 "2007-07-16T02:04:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [July 16, 2007, 2:04am UTC](https://www.ruby-forum.com/t/test-unit-exit-exception-command/109503/1 "2007-07-16T02:04:23Z")

</div>

I’m writing a suite of tests for an sms application.

Because I want to properly test the functionality, it does try to send  
real messages, but with a dummy flag attached.

This is fine, except the dummy flag is kept in the database,  
(so it isn’t loaded until the fixtures load)  
(otherwise I’d do a raise in my test\_helper definition.)

I’ve defined an assertion called assert\_not\_live!,  
which is fine,  
it stops the TestCase that happens to be running,  
but really if such a catastrophic failure occurs,  
I want to stop the whole suite…

is there an exception I can raise which deliberately breaks the test  
runner or perhaps rake container?

---

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [July 16, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/test-unit-exit-exception-command/109503/2 "2007-07-16T18:11:39Z")

</div>

On Mon, 16 Jul 2007 09:04:30 +0900, Matthew R. wrote:

> which is fine,  
> it stops the TestCase that happens to be running,  
> but really if such a catastrophic failure occurs,  
> I want to stop the whole suite…

I was looking for the same thing the other day, I think it would be nice  
to have… I _think_ there could be some way by sending the FINISHED  
signal to the testrunner but I’m not sure. Just re-raising your request  
🙂

BTW, what did you do to stop the testcase?

---

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [July 16, 2007, 6:27pm UTC](https://www.ruby-forum.com/t/test-unit-exit-exception-command/109503/3 "2007-07-16T18:27:34Z")

</div>

gabriele renzi wrote:

> On Mon, 16 Jul 2007 09:04:30 +0900, Matthew R. wrote:

> BTW, what did you do to stop the testcase?

I think I mis-stated that.  
I think of each test as a “test case”.  
Which it is.

---

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [July 16, 2007, 7:22pm UTC](https://www.ruby-forum.com/t/test-unit-exit-exception-command/109503/4 "2007-07-16T19:22:45Z")

</div>

On Tue, 17 Jul 2007 01:40:25 +0900, Matthew R. wrote:

> gabriele renzi wrote:
> 
> > On Mon, 16 Jul 2007 09:04:30 +0900, Matthew R. wrote:
> 
> > BTW, what did you do to stop the testcase?
> 
> I think I mis-stated that.  
> I think of each test as a “test case”.  
> Which it is.

Ah, I see, and yes, I do agree with you, too bad TestCase is not named  
something else 😕
