# question about running unit tests

**URL:** <https://discuss.rubyonrails.org/t/question-about-running-unit-tests/16878>\
**Category:** rubyonrails-talk\
**Created:** [August 11, 2007, 3:06pm UTC](https://discuss.rubyonrails.org/t/question-about-running-unit-tests/16878 "2007-08-11T15:06:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marko\_Vuksanovic](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Marko\_Vuksanovic](https://discuss.rubyonrails.org/u/Marko_Vuksanovic)\
**Post date:** [August 11, 2007, 3:06pm UTC](https://discuss.rubyonrails.org/t/question-about-running-unit-tests/16878/1 "2007-08-11T15:06:36Z")

</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:** ![Phlip](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@Phlip](https://discuss.rubyonrails.org/u/Phlip)\
**Post date:** [August 18, 2007, 3:22pm UTC](https://discuss.rubyonrails.org/t/question-about-running-unit-tests/16878/2 "2007-08-18T15:22:01Z")

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

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