dagolden/test-roo — pull request #5 by djerius (2013-06-22 03:21:42+00:00)
Title: include a test's setup and teardown methods in its subtest group

I recently ran into a situation where assertions in setup and teardown methods were failing, but because those are run outside of the `Test::More::subtest` enclosing the test defined by `Test::Roo::test` their output was not associated with the actual test, but up one level. I found that confusing.

This patch moves the call to `Test::More::subtest` up a level so that the setup & teardown methods are now
associated with the test.

For example, the following code:

```
use Test::Roo;

before each_test => sub { fail('setup') };
after each_test => sub { fail('teardown') };

test 'test 1' => sub { pass('main test') };

run_me;
done_testing;
```
results in this output before the patch:

```
not ok 1 - setup
# Failed test 'setup'
# at uptest.pl line 3.
ok 1 - main test
1..1
ok 2 - test 1
not ok 3 - teardown
# Failed test 'teardown'
# at uptest.pl line 4.
1..3
# Looks like you failed 2 tests of 3.
not ok 1 - testing with main
```

and this after:

```
not ok 1 - setup
# Failed test 'setup'
# at uptest.pl line 3.
ok 2 - main test
not ok 3 - teardown
# Failed test 'teardown'
# at uptest.pl line 4.
1..3
# Looks like you failed 2 tests of 3.
not ok 1 - test 1
# Failed test 'test 1'
# at lib/Test/Roo.pm line 36.
1..1
# Looks like you failed 1 test of 1.
```

To my eye this is more logically and aesthetically pleasing.