# Unit testing with ruby1.9.x

**URL:** <https://www.ruby-forum.com/t/unit-testing-with-ruby1-9-x/164011>\
**Category:** Ruby\
**Created:** [March 26, 2009, 10:13pm UTC](https://www.ruby-forum.com/t/unit-testing-with-ruby1-9-x/164011 "2009-03-26T22:13:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_maclean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@john\_maclean](https://www.ruby-forum.com/u/john_maclean)\
**Post date:** [March 26, 2009, 10:13pm UTC](https://www.ruby-forum.com/t/unit-testing-with-ruby1-9-x/164011/1 "2009-03-26T22:13:17Z")

</div>

Built ruby from a recent svn. Builds fine and works.

ruby19jx --version  
ruby 1.9.2dev (2009-03-18) [i686-linux]

Now for some unit testing;

gem install ‘test-unit’ --remote

run a test on some code;

ruby19jx proj/code/rb/projects/virt/vz/test/test\_vz001.rb  
ruby 1.9.2dev (2009-03-18) [i686-linux]  
/home/jayeola/ix/lib/ruby19jx/gems/1.9.1/gems/test-unit-2.0.2/lib/test/unit/autorunner.rb:1:  
warning: loading in progress, circular require considered harmful -  
/home/j  
ayeola/ix/lib/ruby19jx/gems/1.9.1/gems/test-unit-2.0.2/lib/test/unit.rb  
FE

the autorunner? Am I to `require unit/test2.x` or something?

–  
John M.  
07739 171 531  
MSc (DIC)

Timezone: GMT

---

<div class="post-metadata">

**Author:** ![john\_maclean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@john\_maclean](https://www.ruby-forum.com/u/john_maclean)\
**Post date:** [March 26, 2009, 10:28pm UTC](https://www.ruby-forum.com/t/unit-testing-with-ruby1-9-x/164011/2 "2009-03-26T22:28:00Z")

</div>

On Mar 26, 2009, at 14:08, john maclean wrote:

> Built ruby from a recent svn. Builds fine and works.
> 
> ruby19jx --version  
> ruby 1.9.2dev (2009-03-18) [i686-linux]
> 
> Now for some unit testing;
> 
> gem install ‘test-unit’ --remote

What’s wrong with minitest that ships with 1.9?

---

<div class="post-metadata">

**Author:** ![john\_maclean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@john\_maclean](https://www.ruby-forum.com/u/john_maclean)\
**Post date:** [March 26, 2009, 11:09pm UTC](https://www.ruby-forum.com/t/unit-testing-with-ruby1-9-x/164011/3 "2009-03-26T23:09:38Z")

</div>

2009/3/26 Eric H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> What’s wrong with minitest that ships with 1.9?

Uh, can you point me to some useful docs? Not come across this module  
before and I see no obvious docs, (ri or gem server). /me is surprised  
about this one!

–  
John M.  
07739 171 531  
MSc (DIC)

Timezone: GMT

---

<div class="post-metadata">

**Author:** ![john\_maclean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@john\_maclean](https://www.ruby-forum.com/u/john_maclean)\
**Post date:** [March 26, 2009, 11:47pm UTC](https://www.ruby-forum.com/t/unit-testing-with-ruby1-9-x/164011/4 "2009-03-26T23:47:09Z")

</div>

On Mar 26, 2009, at 15:05, john maclean wrote:

> > > gem install ‘test-unit’ --remote
> > 
> > What’s wrong with minitest that ships with 1.9?
> 
> Uh, can you point me to some useful docs? Not come across this module  
> before and I see no obvious docs, (ri or gem server). /me is surprised  
> about this one!

It’s just like 1.8’s test unit, but with some changes to the assertions:

## $ ri MiniTest::Assertions -------------------------------------------- Class: MiniTest::Assertions [no description]

Instance methods:  
\_assertions, \_assertions=, assert, assert\_block, assert\_empty,  
assert\_equal, assert\_in\_delta, assert\_in\_epsilon, assert\_includes,  
assert\_instance\_of, assert\_kind\_of, assert\_match, assert\_nil,  
assert\_operator, assert\_raises, assert\_respond\_to, assert\_same,  
assert\_send, assert\_throws, capture\_io, exception\_details, flunk,  
message, mu\_pp, pass, refute, refute\_empty, refute\_equal,  
refute\_in\_delta, refute\_in\_epsilon, refute\_includes,  
refute\_instance\_of, refute\_kind\_of, refute\_match, refute\_nil,  
refute\_operator, refute\_respond\_to, refute\_same, skip

See also the minitest gem.

---

<div class="post-metadata">

**Author:** ![john\_maclean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@john\_maclean](https://www.ruby-forum.com/u/john_maclean)\
**Post date:** [March 27, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/unit-testing-with-ruby1-9-x/164011/5 "2009-03-27T15:23:37Z")

</div>

2009/3/27 Tom C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > 
> 
> discussion in various books which take up Ruby 1.9. The library author has  
> Bellingham, Washington, U.S.A: (360) 920-1226  
> \<\< removed\_email\_address@domain.invalid \>\> (email)  
> \<\< [TomCloyd.com](http://TomCloyd.com) \>\> (website) \<\< [sleightmind.wordpress.com](http://sleightmind.wordpress.com) \>\> (mental health  
> weblog)
> 
> ```auto
> 
> ```

I think I’m going to stick with test-unit from gems. Couldn’t really  
follow the ri docs for minitest, although there are a few snippets on  
the net.

gem19jx list test-unit --remote

\*\*\* REMOTE GEMS \*\*\*

test-unit (2.0.2)  
test-unit-ext (0.5.0)  
test-unit-full (0.0.1)  
test-unit-mock (0.30)  
test-unit-runner-fox (0.0.1)  
test-unit-runner-gtk2 (0.0.1)

–  
John M.  
07739 171 531  
MSc (DIC)

Timezone: GMT

---

<div class="post-metadata">

**Author:** ![john\_maclean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@john\_maclean](https://www.ruby-forum.com/u/john_maclean)\
**Post date:** [March 27, 2009, 5:07am UTC](https://www.ruby-forum.com/t/unit-testing-with-ruby1-9-x/164011/6 "2009-03-27T05:07:06Z")

</div>

john maclean wrote:

> 

At the risk of stating what is obvious to some and may not be to all,  
minitest is now the default testing library supplied with 1.9, replacing  
the previously supplied Test::Unit library. I am informed that there one  
can easily obtain the same functionality with minitest - but I know  
essentially nothing about this, and there seems to be no documentation,  
outside of discussion in various books which take up Ruby 1.9. The  
library author has said that the code is easy enough to read that that  
is good documentation.

Hope this helps.

Tom

–

```auto
Tom C., MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< removed_email_address@domain.invalid >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)

```
