Unit testing

Hi,

I want to make unit tests for my Ruby code. What are the pros and cons
of Test::Unit and RubyUnit?

Regards,

Koen

···


“I have yet to see any problem, however complicated, which, when you
looked at it in the right way, did not become still more complicated.”
(Paul Anderson, New Scientist)

Test::Unit is included in the Ruby standard distribution of 1.8pre2 and
will be included in future Ruby standard distributions. I use
Test::Unit and like it very much. RubyUnit came first and, therefore,
quite a few people still use it and have a lot of RubyUnit code. But I
believe Test::Unit is generally accepted as having a more
developer-friendly interface.

Regards,

Mark Wilson

···

On Sunday, June 22, 2003, at 05:11 PM, Koen Vervloesem wrote:

Hi,

I want to make unit tests for my Ruby code. What are the pros and cons
of Test::Unit and RubyUnit?

[snip]

RubyUnit is included with Ruby-1.8.0-preview3.

Test::Unit is not.

···

On Mon, 23 Jun 2003 07:11:36 +0900, Koen Vervloesem wrote:

I want to make unit tests for my Ruby code. What are the pros and cons
of Test::Unit and RubyUnit?


Simon Strandgaard

Hi,

···

In message “Re: unit testing” on 03/06/23, “Simon Strandgaard” 0bz63fz3m1qt3001@sneakemail.com writes:

RubyUnit is included with Ruby-1.8.0-preview3.

Test::Unit is not.

No. test/unit is included in 1.8.0; rubyunit is not.

						matz.

“Yukihiro Matsumoto” matz@ruby-lang.org schrieb im Newsbeitrag
news:1056381040.548029.21632.nullmailer@picachu.netlab.jp…

RubyUnit is included with Ruby-1.8.0-preview3.

Test::Unit is not.

No. test/unit is included in 1.8.0; rubyunit is not.

Personally I’d prefer to have only one of such an important core package
(and of course, that should ship with every release). Is it possible /
reasonable to merge test/unit and RubyUnit into a single package?

Regards

robert

RubyUnit is included with Ruby-1.8.0-preview3.

Test::Unit is not.

No. test/unit is included in 1.8.0; rubyunit is not.

hmmm… they both seems to be in the 1.8.0-p3 tarball ?

tar xzvf ruby-1.8.0-preview3.tar.gz
cd ruby-1.8.0/lib/
ls ru* te*
rubyunit.rb tempfile.rb

runit:
assert.rb error.rb testresult.rb topublic.rb
cui/ testcase.rb testsuite.rb

test:
unit/ unit.rb

···

On Tue, 24 Jun 2003 01:10:47 +0900, Yukihiro Matsumoto wrote:

In message “Re: unit testing” > on 03/06/23, “Simon Strandgaard” 0bz63fz3m1qt3001@sneakemail.com writes:


Simon Strandgaard

Simon Strandgaard wrote:

No. test/unit is included in 1.8.0; rubyunit is not.

hmmm… they both seems to be in the 1.8.0-p3 tarball ?

Look closer. At rubyunit.rb for instance.

—&<—

Author:: Nathaniel Talbott.

Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights

reserved.

License:: Ruby license.

require ‘runit/testcase’
require ‘test/unit’

TestCase = RUNIT::TestCase
—&<—

Looks like the only the rubyunit compatability stuff from test/unit to
me.

···

On Tue, 24 Jun 2003 01:10:47 +0900, Yukihiro Matsumoto wrote:


([ Kent Dahl ]/)_ ~ [ Kent Dahl - Kent Dahl ]/~
))_student_/(( _d L b_/ (pre-) Master of Science in Technology )
( __õ|õ// ) )Industrial economics and technological management(
_
/ö____/ (_engineering.discipline=Computer::Technology)

Hi,

···

In message “Re: unit testing” on 03/06/24, “Robert Klemme” bob.news@gmx.net writes:

No. test/unit is included in 1.8.0; rubyunit is not.

Personally I’d prefer to have only one of such an important core package
(and of course, that should ship with every release). Is it possible /
reasonable to merge test/unit and RubyUnit into a single package?

test/unit contains rubyunit compatible layer. So naturally, it’s
already merged.

						matz.

This is in Test::Unit’s README

Masaki Suketa, for his work on RubyUnit, which filled a vital need in
the Ruby world for a very long time. I’m also grateful for his help in
polishing Test::Unit and getting the RubyUnit compatibility layer
right. His graciousness in allowing Test::Unit to supercede RubyUnit
continues to be a challenge to me to be more willing to defer my own
rights.

So it seems Test::Unit will be the only one to stay.

···

On Tue, Jun 24, 2003 at 12:37:36AM +0900, Robert Klemme wrote:

“Yukihiro Matsumoto” matz@ruby-lang.org schrieb im Newsbeitrag
news:1056381040.548029.21632.nullmailer@picachu.netlab.jp…

RubyUnit is included with Ruby-1.8.0-preview3.

Test::Unit is not.

No. test/unit is included in 1.8.0; rubyunit is not.

Personally I’d prefer to have only one of such an important core package
(and of course, that should ship with every release). Is it possible /
reasonable to merge test/unit and RubyUnit into a single package?


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

“You, sir, are nothing but a pathetically lame salesdroid!
I fart in your general direction!”
– Randseed on #Linux

if I understand you correct, that

  • rubyunit is deprecated
  • test::unit is recommended ???
···

On Tue, 24 Jun 2003 02:02:14 +0900, Yukihiro Matsumoto wrote:

Hi,

In message “Re: unit testing” > on 03/06/24, “Robert Klemme” bob.news@gmx.net writes:

No. test/unit is included in 1.8.0; rubyunit is not.

Personally I’d prefer to have only one of such an important core package
(and of course, that should ship with every release). Is it possible /
reasonable to merge test/unit and RubyUnit into a single package?

test/unit contains rubyunit compatible layer. So naturally, it’s
already merged.


Simon Strandgaard

Test::Unit is the standard test lib.
forget runit if you don’t have an old test suite written with it.
I suppose you still have choice with the Mock stuff :wink:

···

il Mon, 23 Jun 2003 18:21:04 +0200, “Simon Strandgaard” 0bz63fz3m1qt3001@sneakemail.com ha scritto::

if I understand you correct, that

  • rubyunit is deprecated
  • test::unit is recommended ???

Thanks to all for this clarification!

robert

“gabriele renzi” surrender_it@remove.yahoo.it schrieb im Newsbeitrag
news:54lefvg1jtq4d26153vnre7jebosttf9gn@4ax.com

···

il Mon, 23 Jun 2003 18:21:04 +0200, “Simon Strandgaard” > 0bz63fz3m1qt3001@sneakemail.com ha scritto::

if I understand you correct, that

  • rubyunit is deprecated
  • test::unit is recommended ???

Test::Unit is the standard test lib.
forget runit if you don’t have an old test suite written with it.
I suppose you still have choice with the Mock stuff :wink: