# Test::Unit::TestCase#test =\> What's this method for?

**URL:** <https://www.ruby-forum.com/t/test-testcase-test-whats-this-method-for/90088>\
**Category:** Rails\
**Created:** [March 25, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/test-testcase-test-whats-this-method-for/90088 "2007-03-25T22:45:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [March 25, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/test-testcase-test-whats-this-method-for/90088/1 "2007-03-25T22:45:08Z")

</div>

Hi all

I found on this page a neat function that allows to write more semantic  
test method names:

> **[Rails: ActiveRecord Unit Testing](http://blog.jayfields.com/2006/12/rails-activerecord-unit-testing.html)**
>
> There's been a fair amount of information posted recently on the topic of unit testing ActiveRecord::Base subclasses. Of all the infor...

With it one can create tests instead of

def test\_add\_should\_do\_this\_or\_that

# …

end

the following way:

test “add should do this or that” do

# …

end

It enhances the Test::Unit::TestCase class. So far, so good.

Now one time I’ve forgotten to include this new definition. When running  
my tests I got the error

test/unit/country\_test.rb:8:in `test’: wrong number of arguments (1 for  
2) (ArgumentError)

This tells me that there already _is_ some sort of test function! I  
couldn’t find any specification about this method, so I fear that maybe  
I overwrite an important method by including the script above!

Anyone can tell me more about this issue? Thanks a lot.  
Josh

---

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [March 26, 2007, 1:51am UTC](https://www.ruby-forum.com/t/test-testcase-test-whats-this-method-for/90088/2 "2007-03-26T01:51:31Z")

</div>

Joshua M. wrote:

> I found on this page a neat function that allows to write more semantic  
> test method names:
> 
> [Jay Fields' Thoughts: Rails: ActiveRecord Unit Testing](http://blog.jayfields.com/2006/12/rails-activerecord-unit-testing.html)

You might want (IIRC) Behavior Driven Development. That’s a re-skinning  
of  
Test-Driven Development, using systems that easily generate Domain  
Specific  
Languages.

The market leader there is RSpec, so look that up.

–  
Phlip  
["Pigleg too?", week 1](http://flea.sourceforge.net/PiglegToo_1.html)
