[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Matthew Rudy Jacobs

7/16/2007 12:05:00 AM

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?

--
Posted via http://www.ruby-....

3 Answers

gabriele renzi

7/16/2007 4:05:00 PM

0

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

> 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...

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?



--
goto 10: http://www...
blog it: http://riffraff.bl...
blog en: http://www.rif...

Matthew Rudy Jacobs

7/16/2007 4:40:00 PM

0

gabriele renzi wrote:
> On Mon, 16 Jul 2007 09:04:30 +0900, Matthew Rudy 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.

--
Posted via http://www.ruby-....

gabriele renzi

7/16/2007 5:18:00 PM

0

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

> gabriele renzi wrote:
>> On Mon, 16 Jul 2007 09:04:30 +0900, Matthew Rudy 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 :/



--
goto 10: http://www...
blog it: http://riffraff.bl...
blog en: http://www.rif...