Skip to content

Commit 35496e7

Browse files
Chad Granumkarenetheridge
authored andcommitted
Fix things to work with Test::Stream
This is a minimal fix. Ideally Test::Class would be switched around to actually use Test::Stream directly, but that is a huge task. closes #17, and ncludes the amendment that closes #18.
1 parent b23aa22 commit 35496e7

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

t/fail2.t

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ my $identifier = ($Test::More::VERSION < 0.88) ? 'object' : 'thing';
2828
test_out(qr/not ok 1 - (?:The $identifier|undef) isa '?Object'?\n/);
2929
test_out("not ok 2 - cannot create Objects");
3030
test_fail(-12);
31-
test_err( "# (in Object::Test->_test_new)" );
32-
test_err(qr/#\s+(?:The $identifier|undef) isn't defined\n/);
33-
test_fail(-15);
31+
test_err( $_ ) for $INC{'Test/Stream.pm'}
32+
? (qr/#\s+(?:The $identifier|undef) isn't defined\n/, "# (in Object::Test->_test_new)")
33+
: ("# (in Object::Test->_test_new)", qr/#\s+(?:The $identifier|undef) isn't defined\n/);
34+
test_fail(-16);
3435
test_err( "# (in Object::Test->_test_new)" );
3536

3637
Object::Test->runtests;

t/runtests_die.t

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ my $identifier = ($Test::More::VERSION < 0.88) ? 'object' : 'thing';
2525

2626
test_out( qr/not ok 1 - (?:The $identifier|undef) isa '?Object'?\n/);
2727
test_err( "# Failed test ($filename at line 15)");
28-
test_err( "# (in Foo->test_object)" );
29-
test_err( qr/# (?:The $identifier|undef) isn't defined\n/);
28+
test_err( $_ ) for $INC{'Test/Stream.pm'}
29+
? (qr/# (?:The $identifier|undef) isn't defined\n/, "# (in Foo->test_object)")
30+
: ("# (in Foo->test_object)", qr/# (?:The $identifier|undef) isn't defined\n/);
3031
test_out( "not ok 2 - test_object died (could not create object)");
31-
test_err( "# Failed test ($filename at line 33)");
32-
test_err( "# (in Foo->test_object)" );
32+
test_err("# Failed test ($filename at line 34)");
33+
test_err("# (in Foo->test_object)");
3334
Foo->runtests;
3435
test_test("early die handled");

0 commit comments

Comments
 (0)