# Question about running unit tests

**URL:** <https://www.ruby-forum.com/t/question-about-running-unit-tests/111821>\
**Category:** Rails\
**Created:** [August 11, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/question-about-running-unit-tests/111821 "2007-08-11T17:08:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marko\_Vuksanovic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@Marko\_Vuksanovic](https://www.ruby-forum.com/u/Marko_Vuksanovic)\
**Post date:** [August 11, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/question-about-running-unit-tests/111821/1 "2007-08-11T17:08:02Z")

</div>

I have two questions regarding running unit tests

1. Is there a way to run a specific unit test using rake command,…  
sth like “rake test:units xxxxx”. I’d like to achieve the same effect  
as using, for example, “ruby test/unit/product\_test.rb” command

2. Is there a way to somehow mark a test not to be run when using  
“rake test:units” command?

---

<div class="post-metadata">

**Author:** ![Marko\_Vuksanovic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@Marko\_Vuksanovic](https://www.ruby-forum.com/u/Marko_Vuksanovic)\
**Post date:** [August 18, 2007, 5:23pm UTC](https://www.ruby-forum.com/t/question-about-running-unit-tests/111821/2 "2007-08-18T17:23:03Z")

</div>

Apologies on behalf of the group for the late answer!

Marko Vuksanovic wrote:

> I have two questions regarding running unit tests
> 
> 1. Is there a way to run a specific unit test using rake command,…  
> sth like “rake test:units xxxxx”. I’d like to achieve the same effect  
> as using, for example, “ruby test/unit/product\_test.rb” command

rake test:units TESTOPTS=-ntest\_this\_case\_only

> 1. Is there a way to somehow mark a test not to be run when using  
> “rake test:units” command?

Don’t. Because you never ‘svn ci’ without passing all your tests first  
(and  
because you put the tests and ‘svn ci’ inside a rake task called ‘rake  
ci’),  
all your tests should always pass.

To temporarily suspend a test, put return # TODO at its start. And note  
that  
the -n option takes a regexp, such as -n/test\_subset/

–  
Phlip  
[http://www.oreilly.com/catalog/9780596510657/](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax
