If you don’t know what Test::Unit is, I’ve included an explanation
further down. For everyone else, here’s some highlights from the
ChangeLog (you can read the whole thing at http://testunit.talbott.ws/ChangeLog):
Added more output options to the console test runner.
Changed Object#id calls to Object#id to remove deprecation
warnings under 1.7.
Did a little performance tuning.
Fixed a problem in stack trace filtering in Error.filter.
Added the ability to pick the runner when running automatically
(thanks to Eivind Eklund).
Fixed debugging support in unit.rb.
Made the failure caused by running an empty suite clear, consistent,
and changeable.
!Removed the return value from Assertions#assert_match.
Modified tests to make sure all assertions are returning nil unless
they’re explicitly supposed to do something else.
!Made TestCase#initialize throw :invalid_test if the test method
specified does not exist (this is in addition to the arity check that
was already in place).
!Changed #assert_match to use #=~ instead of #match; it can now
handle strings as patterns, too.
Fixed warnings under 1.8 caused by not using a 0 before the decimal
point of floats.
Notes:
Test::Unit has been imported in to ruby 1.8. If you’re running
against the latest CVS, you shouldn’t need to download this!
README:
Unit testing is making waves all over the place, largely due to the fact
that it is a core practice of XP. While XP is great, unit testing has
been around for a long time and has always been a good idea. One of the
keys to good unit testing, though, is not just writing tests, but having
tests. What’s the difference? Well, if you just write a test and throw
it away, you have no guarantee that something won’t change later which
breaks your code. If, on the other hand, you have tests (obviously you
have to write them first), and run them as often as possible, you slowly
build up a wall of things that cannot break without you immediately
knowing about it. This is when unit testing hits its peak usefulness.
Enter Test::Unit, a framework for unit testing in Ruby, helping you to
design, debug and evaluate your code by making it easy to write and have
tests for it.
I’m not familiar with Test::Unit. I’m certainly familiar with software source
comming with a set of tests that you are supposed to run. Is that what this is?
What does this have to do with XP? Do you mean Windows XP? If so, what makes it
different from the test suites that I’ve been using before XP came out?
···
README:
Unit testing is making waves all over the place, largely due to the fact
that it is a core practice of XP. While XP is great, unit testing has
been around for a long time and has always been a good idea. One of the
keys to good unit testing, though, is not just writing tests, but having
tests. What’s the difference? Well, if you just write a test and throw
it away, you have no guarantee that something won’t change later which
breaks your code. If, on the other hand, you have tests (obviously you
have to write them first), and run them as often as possible, you slowly
build up a wall of things that cannot break without you immediately
knowing about it. This is when unit testing hits its peak usefulness.
Enter Test::Unit, a framework for unit testing in Ruby, helping you to
design, debug and evaluate your code by making it easy to write and have
tests for it.
If you don’t know what Test::Unit is, I’ve included an explanation
further down. For everyone else, here’s some highlights from the
ChangeLog (you can read the whole thing at http://testunit.talbott.ws/ChangeLog):
Did a little performance tuning.
This is great! In my case, Test::Unit is now only a tiny bit slower
than RubyUnit (still using the RubyUnit compatibility layer). It used
to
I have two suggested patches to the console ui. The “Finished in
seconds” includes to much precision in the seconds (nobody cares
if it finished in 10.3234323 rather than 10.3234322 seconds), and the
console runner never flushes io when it prints out the progress dots
so they don’t function as progress indicators.
— lib/test/unit/ui/console/testrunner.rb Tue Feb 11 21:22:33 2003
+++ /home/matt/pkg/stow/ruby-cvs/lib/ruby/1.8/test/unit/ui/console/testrunner.rbTue Feb 11 23:14:10 2003
@@ -90,7 +90,8 @@
What does this have to do with XP? Do you mean Windows XP? If so, what
makes it different from the test suites that I’ve been using before XP came
out?
I’m not familiar with Test::Unit. I’m certainly familiar with software
source comming with a set of tests that you are supposed to run. Is that
what this is?
You’ll notice TDD (Test Driven Development) listed in the list of XP practices
via the link.
Hope this helps-- // Bruce
···
On Tuesday 11 February 2003 11:56 pm, Daniel Carrera wrote:
The “Finished in seconds” includes to much precision in the seconds
(nobody cares if it finished in 10.3234323 rather than 10.3234322 seconds)
Actually I do: that is the only way I can tell that it re-ran sometimes
when I use \C-c \C-c in emacs to re-run the tests. Otherwise, I’ll need
a date stamp or some such.
···
–
Bil Kleb
NASA Langley Research Center
Hampton, Virginia, USA
This is great! In my case, Test::Unit is now only a tiny bit
slower than RubyUnit (still using the RubyUnit compatibility
layer). It used to
Was the rest of what you were going to say interesting?
I have two suggested patches to the console ui. The
“Finished in seconds” includes to much precision in the
seconds (nobody cares if it finished in 10.3234323 rather
than 10.3234322 seconds), and the console runner never
flushes io when it prints out the progress dots so they don’t
function as progress indicators.
The “Finished in seconds” includes to much precision
in the seconds (nobody cares if it finished in 10.3234323
rather than 10.3234322 seconds)
Actually I do: that is the only way I can tell that it re-ran
sometimes when I use \C-c \C-c in emacs to re-run the tests.
Otherwise, I’ll need a date stamp or some such.
Actually, a date/time stamp sounds like the better, more direct solution
here. Added to the TODO.
This is great! In my case, Test::Unit is now only a tiny bit
slower than RubyUnit (still using the RubyUnit compatibility
layer). It used to
Was the rest of what you were going to say interesting?
It used to be about 100% slower than RubyUnit, now it is only about
30% slower. Very livable – ~20,000 assertions on a 233 MHz Pentium
in 30 seconds (includes my test code running time).