[Rubygems-developers] RubyGems Alpha II?
jim at weirichhouse.org
Tue Mar 30 23:25:15 EST 2004
Mauricio Fernández said:
> Not a feature but something I think would be good to consider before a
> release: testing.
> After a cvs update -dPR, this is what I'm getting when running
> 52 tests, 49 assertions, 2 failures, 3 errors
Wow, that's more tests than when I looked last time. Someone has been busy!
But I agree with Batsman, a carefully designed suite of unit tests will
help use in the long run as code is changing. But we need a good
commitment from the developers to keep the unit tests up to date and
Some test issues. Currently, the tests do not do a good job of separating
the installed code from the code in the working directory. Ideally, the
unit tests should work only on the code in the working directory. I just
tried the tests and got the 2 failures/3 errors listed above. Then I
installed the working directory code and errors went down to 1 (apparently
expected) failure. This tells me we are testing the installed stuff.
We can correct that through careful use of the -I directive when you start
Another issue. There is a test target in the provided rake file. Just
type "rake" and it will automatically run the unit tests. However, it
looks for files beginning with "test_" in the test directory, so the
"test_all" file gets run as well. Changing that the name of that file to
something like "run_all_tests.rb" will fix that (but then again, you
really don't need test_all.rb if you use rake ... you do have rake don't
you? ... hint: gem -Ri rake :-)
And one last issue. Unit tests are well and good, but even XP recommends
a functional level of testing. At this level you would actually run the
code from the command line a making sure things installed correctly or the
proper listing was made. Kind of an end-to-end test of the entire
program. I was thinking about using the Ara's session module to do some
command line testing at this level. Any opinions? Does anyone else feel
this is worthwhile?
-- Jim Weirich jim at weirichhouse.org http://onestepback.org
"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)
More information about the Rubygems-developers