Given the following unit tests …
– Unit Tests --------------------------------
class TestOne < Test::Unit::TestCase
def test_ok
assert true, "this will pass"
end
end
class TestTwo < Test::Unit::TestCase
include UndefinedModule
def test_also_ok
assert true, "This will be ignored"
end
end
– END ---------------------------------------
Running them gives …
– UNIT TEST OUTPUT --------------------------
traken$ ruby testbug.rb
testbug.rb:13: uninitialized constant UndefinedModule at TestTwo
(NameError)
Loaded suite testbug
Started
…
Finished in 0.004499 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
– END ---------------------------------------
Granted, there is a NameError in the output of the testcase, but the
final line (0 failures, 0 errors) gives no hint of that.
Is is possible for Unit::Test to trap that error and report it in the
summary line? Or am I asking for the impossible?
BTW, great job on Test::Unit … I use it ALL the time.
···
–
– 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)