Test/Unit question

Is there any easy way to have a test/unit failure display the call stack
of the failure? Typically it displays the test name and test case but
not where in the test function exactly if the assertion was in a
function called by test function. So if my test case is as below:

require “test/unit”

class SillyTest < Test::Unit::TestCase
def check_result(x1, x2, y1, y2)
assert_equal(x1, x2)
assert_equal(y1, y2)
end

def test_values_1
    check_result(1,2,3,4)
    check_result(1,2,4,5)
end

def test_values_2
    check_result(1,2,4,5)
    check_result(1,2,5,6)
end

end

and my output is:

  1. Failure!!!
    test_values_1(SillyTest) [SillyTest.rb: 5]:
    <1> expected but was
    <2>

I don’t know where the failure originated in the test case. It could be
line 10 or 11.

Thanks for a great tool!

Steve Tuckner

Is there any easy way to have a test/unit failure display the call stack
of the
failure? Typically it displays the test name and test case but not where
in the
test function exactly if the assertion was in a function called by test
function.

Try it out in 1.8.1… I think you might find it more to your liking (I know
I like it better).

HTH,

Nathaniel

<:((><

···

Steve Tuckner [mailto:STUCKNER@MULTITECH.COM] wrote:

Thanks, I will give that a try!

···

-----Original Message-----
From: Nathaniel Talbott [mailto:nathaniel@NOSPAMtalbott.ws]
Sent: Monday, November 03, 2003 1:59 PM
To: ruby-talk ML
Subject: Re: Test/Unit question

Steve Tuckner [mailto:STUCKNER@MULTITECH.COM] wrote:

Is there any easy way to have a test/unit failure display
the call stack
of the
failure? Typically it displays the test name and test case
but not where
in the
test function exactly if the assertion was in a function
called by test
function.

Try it out in 1.8.1… I think you might find it more to your
liking (I know
I like it better).

HTH,

Nathaniel

<:((><