Test unit stuff

I am preparing a couple of packages for release on RAA (they are
ports of Perl packages), and have done some unit tests in RubyUnit; I
have read somewhere that Test::Unit is the successor to RubyUnit –
is this the case, and if so, what is the real difference between
them? Are they similar enough to be able to use either, depending on
what is available on the system?

-austin
– Austin Ziegler, austin@halostatue.ca on 2002.10.14 at 18.59.59

I am preparing a couple of packages for release on RAA (they are
ports of Perl packages), and have done some unit tests in RubyUnit; I
have read somewhere that Test::Unit is the successor to RubyUnit –
is this the case,

Yes it is. The packages have been combined and RubyUnit is no longer
actively maintained.

[…] Are they similar enough to be able to use either, depending on
what is available on the system?

Test::Unit does have a RubyUnit emulation mode, so writing to Test::Unit
is probably your best bet.

Converting from RubyUnit to Test::Unit is pretty easy. Generally it
involves …

  1. Changing “require ‘runit’” to “require ‘test/unit’”.

  2. Changing
    class TestXYZ < RUNIT::TestCase
    to
    class TestXYZ < Test::Unit::Testcase

  3. Change and “assert_equals” to “assert_equal”, and any
    “assert_exception” to “assert_raises”

···

On Mon, 2002-10-14 at 19:05, Austin Ziegler wrote:


– Jim Weirich jweirich@one.net http://w3.one.net/~jweirich

“Beware of bugs in the above code; I have only proved it correct,
not tried it.” – Donald Knuth (in a memo to Peter van Emde Boas)

Converting from RubyUnit to Test::Unit is pretty easy. Generally it
involves …

  1. Changing “require ‘runit’” to “require ‘test/unit’”.

  2. Changing
    class TestXYZ < RUNIT::TestCase
    to
    class TestXYZ < Test::Unit::Testcase

  3. Change and “assert_equals” to “assert_equal”, and any
    “assert_exception” to “assert_raises”

IIRC,

  1. changing setup to set_up (and teardown to tear_down … ? can’t remember)

Chris