Permalink
Browse files

Fix rt#55324. Make TC pass with new Test::Simple.

This was a bug in a test not noticing the new Test::Simple output.  It was not
a bug in Test::Class.
  • Loading branch information...
1 parent 487bad6 commit f00f1dc194c6ae9232011879d63995705337233e @Ovid Ovid committed Aug 11, 2010
Showing with 20 additions and 3 deletions.
  1. +4 −0 Changes
  2. +16 −3 t/todo.t
View
@@ -1,5 +1,9 @@
Changes for Perl extension Test-Class
+0.36
+ - Apply t/todo.t patch to fix RT#55324 (test bug, not Test::Class bug).
+ This makes the test suite pass with Test::Simple 0.95_01 and greater.
+
0.35 - or the "Yay! Open Source For The Win!" release [2010-04-28]
- Introducing Ovid & Mark Morgan in "Folk with commit bits who aren't
afraid to use them!"
View
@@ -18,14 +18,27 @@ sub todo_test : Test {
package main;
use Test::Builder::Tester tests => 2;
+use Test::More;
$ENV{TEST_VERBOSE}=0;
my $filename = sub { return (caller)[1] }->();
-test_out( "not ok 1 - object live # TODO unimplemented" );
-test_err( "# Failed (TODO) test ($filename at line 16)" );
+my $test_more_version = eval($Test::More::VERSION);
+diag "Test::More: $test_more_version";
-test_err( "# (in Foo->todo_test)" );
+test_out( "not ok 1 - object live # TODO unimplemented" );
+if ($test_more_version >= 0.9501) {
+ # Test-Simple-0.95_01 or later output TODO message to output handle.
+ # see http://cpansearch.perl.org/src/MSCHWERN/Test-Simple-0.95_01/Changes
+ # Test::Builder::Tester now sets $tb->todo_output to the output handle and
+ # not the error handle (to be in accordance with the default behaviour of
+ # Test::Builder and allow for testing TODO test behaviour).
+ test_out( "# Failed (TODO) test ($filename at line 16)" );
+ test_out( "# (in Foo->todo_test)" );
+} else {
+ test_err( "# Failed (TODO) test ($filename at line 16)" );
+ test_err( "# (in Foo->todo_test)" );
+}
Foo->runtests;
test_test("todo tests work");

0 comments on commit f00f1dc

Please sign in to comment.