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?
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?
On Sun, Jul 24, 2011 at 6:13 AM, Mario R. [email protected] 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/.
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 9:21 AM, Josh C. [email protected]
wrote:
def last_test
This should be def test_last
since TestUnit expects the names of test
methods to begin with the word “test”.
On Jul 24, 2011, at 4:13 AM, Mario R. 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?
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 Mon, Jul 25, 2011 at 09:33:16AM +0900, Eric H. 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.
Maybe one would want to collect some kind of aggregate data while
testing
and output it after executing all tests . . . ?
this is exactly what I was looking for.
thanks a lot.
Josh C. wrote in post #1012708:
On Sun, Jul 24, 2011 at 6:13 AM, Mario R. [email protected] wrote:
I need to run some code always on the last testcase that is run in any
testsuite
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs