# \[Q\] Test::Unit

**URL:** <https://rubytalk.org/t/q-test-unit/4781>\
**Category:** ruby-talk\
**Created:** [17 February 2003 22:03 UTC](https://rubytalk.org/t/q-test-unit/4781 "2003-02-17T22:03:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Berger\_Daniel2](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Berger\_Daniel2](https://rubytalk.org/u/Berger_Daniel2)\
**Post date:** [17 February 2003 22:03 UTC](https://rubytalk.org/t/q-test-unit/4781/1 "2003-02-17T22:03:55Z")

</div>

> From: Daniel Carrera [[mailto:dcarrera@math.umd.edu](mailto:dcarrera@math.umd.edu)]  
> I’m trying to figure out how to ust Test::Unit. I’ve read the  
> documentation in:  
> [http://testunit.talbott.ws/doc/index.html](http://testunit.talbott.ws/doc/index.html)
> 
> But I’m no closer to understanding it than I was before. At  
> the end of  
> the page, the author says that (s)he’d like to get some  
> feedback. Whoever  
> the author might be, here is some feedback:
> 
> 1. Include your name and email so that it’s easier to send  
> you feedback.

Eh? I’m guessing you got testunit off the RAA, in which case you would have  
seen that Nathaniel Talbott is the author. His name and email address are  
also in the README file. It’s ALSO in the index.html file, under “Contact  
Information”.

> 1. Could you include an example of how I’d use Test::Unit?

class TC\_Foo \< Test::Unit::TestCase  
def setup  
@f = Foo.new  
end

def test\_bar  
assert\_equal(“bar”,@f.bar,“Bad result for ‘bar()’”)  
end

def teardown  
@f = nil  
end  
end

There are also some examples in the “examples” directory.

Regards,

Dan

> **···**
>
> > -----Original Message-----

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [17 February 2003 22:11 UTC](https://rubytalk.org/t/q-test-unit/4781/2 "2003-02-17T22:11:38Z")

</div>

> > 1. Include your name and email so that it’s easier to send  
> > you feedback.
> 
> Eh? I’m guessing you got testunit off the RAA, in which case you would have  
> seen that Nathaniel Talbott is the author. His name and email address are  
> also in the README file. It’s ALSO in the index.html file, under “Contact  
> Information”.

No. As I said in my email, I was looking at:

[http://testunit.talbott.ws/doc/index.html](http://testunit.talbott.ws/doc/index.html)

Now that you mention it, I could have tried RAA. But my suggestion of  
including a name and email in the documentation above is still good.

> class TC\_Foo \< Test::Unit::TestCase  
> [snip]  
> def test\_bar  
> assert\_equal(“bar”,@f.bar,“Bad result for ‘bar()’”)  
> end  
> [snip]  
> end

Does that mean that it’s only possible to test the output of public  
methods?

> **···**
>
> On Tue, Feb 18, 2003 at 07:03:55AM +0900, Berger, Daniel wrote:
> 
> –  
> Daniel Carrera  
> Graduate Teaching Assistant. Math Dept.  
> University of Maryland. (301) 405-5137

---

<div class="post-metadata">

**Author:** ![Mark\_Wilson](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@Mark\_Wilson](https://rubytalk.org/u/Mark_Wilson)\
**Post date:** [17 February 2003 22:24 UTC](https://rubytalk.org/t/q-test-unit/4781/3 "2003-02-17T22:24:03Z")

</div>

There’s a thread on this started by Mauricio Fernandez that started  
around February 12 and is titled “Unit Testing Private Methods”. Enjoy!

> **···**
>
> On Monday, February 17, 2003, at 05:11 PM, Daniel Carrera wrote:
> 
> > [snip]
> 
> > Does that mean that it’s only possible to test the output of public  
> > methods?
> > 
> > [snip]

---

<div class="post-metadata">

**Author:** ![Tim\_Hunter](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tim\_Hunter](https://rubytalk.org/u/Tim_Hunter)\
**Post date:** [17 February 2003 23:46 UTC](https://rubytalk.org/t/q-test-unit/4781/4 "2003-02-17T23:46:43Z")

</div>

Clearly the page is different when you look at it than when I do. When I  
look at the page with that URL, there is a header called “Contact  
Information” that includes the email address: testunit@talbott.ws.

I’m using Galeon 1.2.5, if that makes any difference.

> **···**
>
> On Tue, 18 Feb 2003 07:11:38 +0900, Daniel Carrera wrote:
> 
> > On Tue, Feb 18, 2003 at 07:03:55AM +0900, Berger, Daniel wrote:
> > 
> > > > 1. Include your name and email so that it’s easier to send you  
> > > > feedback.
> > > 
> > > Eh? I’m guessing you got testunit off the RAA, in which case you would  
> > > have seen that Nathaniel Talbott is the author. His name and email  
> > > address are also in the README file. It’s ALSO in the index.html file,  
> > > under “Contact Information”.
> > 
> > No. As I said in my email, I was looking at:
> > 
> > [http://testunit.talbott.ws/doc/index.html](http://testunit.talbott.ws/doc/index.html)
> > 
> > Now that you mention it, I could have tried RAA. But my suggestion of  
> > including a name and email in the documentation above is still good.
