Test::Unit gives no errors on loading problems

J

Jim Weirich

I'm rather surprised by the following result:

$ cat x.rb
require 'test/unit'
requrie 'somethingelse'

class TestIt < Test::Unit::TestCase
def test_one
assert_equal 1, 2
end
end

$ ruby x.rb
Loaded suite x
Started

Finished in 0.005333 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

Although the 0 tests/0 assertions is a big clue something is wrong, I
would have expected a little more helpful indication of error (e.g.
Undefined method 'requrie') along with the file name and line number.

It seems that test/unit is swallowing this information somehow/
 
N

Nathaniel Talbott

I'm rather surprised by the following result:

$ cat x.rb
require 'test/unit'
requrie 'somethingelse'

class TestIt < Test::Unit::TestCase
def test_one
assert_equal 1, 2
end
end

$ ruby x.rb
Loaded suite x
Started

Finished in 0.005333 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

Although the 0 tests/0 assertions is a big clue something is wrong, I
would have expected a little more helpful indication of error (e.g.
Undefined method 'requrie') along with the file name and line number.

It seems that test/unit is swallowing this information somehow/

What version of Ruby is this occurring in? I remember there being a bug
that caused this a while back. Currently I receive the following:

ntalbott@jacob:~/sandbox$ ruby -v t.rb
ruby 1.9.0 (2004-04-14) [powerpc-darwin]
t.rb:3: undefined method `requrie' for main:Object (NoMethodError)

Which seems right to me.


Nathaniel
Terralien, Inc.

<:((><
 
J

Jim Weirich

Nathaniel said:
What version of Ruby is this occurring in? I remember there being a bug
that caused this a while back.

Oops, sorry. I had an old version of Test::Unit installed in the
site_ruby directory. I clobbered that and everything is fine.

I'm running the stable version of 1.8.1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top