Problems with TestUnit

Hello,

Were there any major changes to TestUnit work since ruby version 1.7?
My tests worked just before I’ve setup ruby 1.8.1(from cvs), maybe problem is not
in TestUnit at all, but I need to now, if there were something that might break the
tests written for older versions of TestUnit.
The problem is that tests behavior is kind of insane.
I have this test case runner, run_tests.rb(see comments):

require 'test/unit’
require 'test/unit/ui/console/testrunner’
require 'tests/test_bla1.rb’
require 'tests/test_bla2.rb’
require ‘tests/test_bla3.rb’

···

Ruby never comes to this place now, the results are shown up already.

I’m woundering why is this happening? The strange thing is also that

test case in test_bla2.rb doesn’t checked at all, but in test_bla3.rb

it is.

class TS_WebTests
def self.suite
suite = Test::Unit::TestSuite.new "The Bla Library Tests"
suite << TC_Bla1.suite
suite << TC_Bla2.suite
suite << TC_Bla3.suite
return suite
end
end

Test::Unit::UI::Console::TestRunner.run(TS_WebTests)

Thanks for any help in advance!


sdmitry -=- Dmitry V. Sabanin
MuraveyLabs.

Were there any major changes to TestUnit work since ruby version 1.7?

Yes. Quite a few, actually. I can’t think of a change off the top of my
head that should break code like this, though.

My tests worked just before I’ve setup ruby 1.8.1(from cvs), maybe
problem is not
in TestUnit at all, but I need to now, if there were something that
might break the
tests written for older versions of TestUnit.
The problem is that tests behavior is kind of insane.

Can you do a couple of things for me?

  • What is the output of -v for the ruby you’re running this with?
  • Try running with -d and make sure there are no unexpected exceptions
    that are being thrown. There was an issue with Test::Unit masking
    exceptions that has been resolved very recently.
  • Any chance you can send me the offending code? It would help a lot in
    finding the problem.

Also, you can check out the thread beginning with
http://www.ruby-talk.org/86899 for some possible solutions to a similar
problem.

HTH,

Nathaniel

<:((><

···

On Dec 4, 2003, at 12:23, Dmitry V. Sabanin wrote:

Can you do a couple of things for me?

  • What is the output of -v for the ruby you’re running this with?
    There are some warnings but they are not related to problem.
  • Try running with -d and make sure there are no unexpected exceptions
    that are being thrown. There was an issue with Test::Unit masking
    exceptions that has been resolved very recently.
    Oooops…
    I found the problem, one of the files was not loaded in ‘require’, but I didn’t
    see exception. Why TU hides exceptions, and how can I work around that?
    How do you think, adding -d to a ruby she-bang line of run_tests.rb is fine?
    Anyway, thanks a lot for your help and for a best testing framework I’ve ever seen!
···

On Friday 05 December 2003 00:38, Nathaniel Talbott wrote:

HTH,

Nathaniel

<:((><


sdmitry -=- Dmitry V. Sabanin
MuraveyLabs.

  • What is the output of -v for the ruby you’re running this with?
    There are some warnings but they are not related to problem.

Actually, I was looking for the version (including date) of Ruby you’re
using.

  • Try running with -d and make sure there are no unexpected exceptions
    that are being thrown. There was an issue with Test::Unit masking
    exceptions that has been resolved very recently.
    Oooops…
    I found the problem, one of the files was not loaded in ‘require’, but
    I didn’t
    see exception. Why TU hides exceptions, and how can I work around that?
    How do you think, adding -d to a ruby she-bang line of run_tests.rb is
    fine?
    Anyway, thanks a lot for your help and for a best testing framework
    I’ve ever seen!

This should be fixed in the latest CVS. If for some reason you can’t
use that, -d is the suggested work-around.

HTH,

Nathaniel

<:((><

···

On Dec 4, 2003, at 22:51, Dmitry V. Sabanin wrote:

  • What is the output of -v for the ruby you’re running this with?

There are some warnings but they are not related to problem.
Actually, I was looking for the version (including date) of Ruby you’re
using.
Oh, sorry, I didn’t understand that :slight_smile:
My version is:
ruby 1.8.1 (2003-11-10) [i686-linux]
This should be fixed in the latest CVS. If for some reason you can’t
use that, -d is the suggested work-around.
Strange, I just upgraded my cvs version, and I have the same problem without -d.
I guess I need to investigate some more, maybe ruby looks for TestUnit files in wrong load
path…

···

On Friday 05 December 2003 11:17, Nathaniel Talbott wrote:

On Dec 4, 2003, at 22:51, Dmitry V. Sabanin wrote:

HTH,

Nathaniel

<:((><


sdmitry -=- Dmitry V. Sabanin
MuraveyLabs.

Actually, I was looking for the version (including date) of Ruby
you’re
using.
Oh, sorry, I didn’t understand that :slight_smile:
My version is:
ruby 1.8.1 (2003-11-10) [i686-linux]

That version would definitely be affected by the bug. Any version dated
December or later should not be.

This should be fixed in the latest CVS. If for some reason you can’t
use that, -d is the suggested work-around.
Strange, I just upgraded my cvs version, and I have the same problem
without -d.
I guess I need to investigate some more, maybe ruby looks for TestUnit
files in wrong load
path…

Well I’ve just checked, and it definitely seems to be working correctly
in the most recent CVS:

ntalbott@jacob:~/cvs/ruby$ ruby -v t.rb
ruby 1.8.1 (2003-12-05) [powerpc-darwin]
t.rb:3: unhandled exception
ntalbott@jacob:~/cvs/ruby$ cat t.rb
require ‘test/unit’
raise
ntalbott@jacob:~/cvs/ruby$

So yes, you might be requiring an old set of Test::Unit files. Let me
know if you can’t get it working.

HTH,

Nathaniel

<:((><

···

On Dec 5, 2003, at 01:27, Dmitry V. Sabanin wrote: