On Fri Apr 09 07:31:14 2010, ADIE wrote:
Show quoted text> I agree. Makes complete sense. Added to do do list. Patches welcome :-)
Patch attached :)
I didn't bump up the version number because I wasn't sure what you'd do with that.
Also, is there a public repository available? I'd much prefer to submit patches with 'svn diff' or
(heaven!) a git pull request or something like that. In fact, I'd be happy to throw this up on
github (or let you do it) to make contributions easier.
Cheers,
Ovid
diff -r -u Test-Class.orig/Changes Test-Class/Changes
--- Test-Class.orig/Changes 2010-03-08 07:06:22.000000000 +0100
+++ Test-Class/Changes 2010-04-10 09:56:06.000000000 +0200
@@ -1,5 +1,8 @@
Changes for Perl extension Test-Class
+0.??
+ - When extra tests are run, now reports class name along with method name.
+
0.34 - or the "Abandon ship!" release
- Harmonised $VERSION to the same value (Adam Kennedy)
- Devel::Symdump has a bug which is really a bug in core and won't be fixed.
diff -r -u Test-Class.orig/lib/Test/Class.pm Test-Class/lib/Test/Class.pm
--- Test-Class.orig/lib/Test/Class.pm 2010-03-08 07:06:22.000000000 +0100
+++ Test-Class/lib/Test/Class.pm 2010-04-10 09:54:44.000000000 +0200
@@ -265,7 +265,8 @@
_exception_failure($self, $method, $exception, $tests)
unless $exception eq '';
} elsif ($num_done > $num_expected) {
- $Builder->diag("expected $num_expected test(s) in $method, $num_done completed\n");
+ my $class = ref $self;
+ $Builder->diag("expected $num_expected test(s) in $class\::$method, $num_done completed\n");
} else {
until (($Builder->current_test - $num_start) >= $num_expected) {
if ($exception ne '') {
diff -r -u Test-Class.orig/t/runtests_extra.t Test-Class/t/runtests_extra.t
--- Test-Class.orig/t/runtests_extra.t 2010-03-08 07:06:22.000000000 +0100
+++ Test-Class/t/runtests_extra.t 2010-04-10 09:54:36.000000000 +0200
@@ -18,6 +18,6 @@
test_out("ok 1 - expected test");
test_out("ok 2 - extra test");
-test_err("# expected 1 test(s) in extra_test, 2 completed");
+test_err("# expected 1 test(s) in Foo::extra_test, 2 completed");
Foo->runtests;
test_test("extra test detected");