I need to run some code always on the last testcase that is run in any
testsuite
How could I know that I'm running the last test case?
···
--
Posted via http://www.ruby-forum.com/.
I need to run some code always on the last testcase that is run in any
testsuite
How could I know that I'm running the last test case?
--
Posted via http://www.ruby-forum.com/.
If this isn't what you're trying to do, then you need to take some time to
make it more explicit, because there are a lot of potential interpretations
for what you asked.
at_exit { puts "After last test" }
require 'test/unit'
class TestSuite < Test::Unit::TestCase
def last_test
puts "Last test"
end
end
On Sun, Jul 24, 2011 at 6:13 AM, Mario Ruiz <tcblues@gmail.com> wrote:
I need to run some code always on the last testcase that is run in any
testsuiteHow could I know that I'm running the last test case?
--
Posted via http://www.ruby-forum.com/\.
Why do you need to run something after the last test case?
Each test should clean up after itself when done so that at the end there is nothing extra to do.
On Jul 24, 2011, at 4:13 AM, Mario Ruiz wrote:
I need to run some code always on the last testcase that is run in any
testsuiteHow could I know that I'm running the last test case?
This should be `def test_last` since TestUnit expects the names of test
methods to begin with the word "test".
On Sun, Jul 24, 2011 at 9:21 AM, Josh Cheek <josh.cheek@gmail.com> wrote:
def last_test
this is exactly what I was looking for.
thanks a lot.
Josh Cheek wrote in post #1012708:
On Sun, Jul 24, 2011 at 6:13 AM, Mario Ruiz <tcblues@gmail.com> wrote:
I need to run some code always on the last testcase that is run in any
testsuite
--
Posted via http://www.ruby-forum.com/\.
Maybe one would want to collect some kind of aggregate data while testing
and output it after executing all tests . . . ?
On Mon, Jul 25, 2011 at 09:33:16AM +0900, Eric Hodel wrote:
Why do you need to run something after the last test case?
Each test should clean up after itself when done so that at the end
there is nothing extra to do.
--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]