On Wed Jan 06 16:36:43 2016, EXODIST wrote:
Show quoted text> I will try to have a patch for this when I have a moment.
Here is the patch.
From b22e32e94a7f6ef52d3470e9502e85b262a3e7e8 Mon Sep 17 00:00:00 2001
From: Chad Granum <exodist7@gmail.com>
Date: Tue, 15 Mar 2016 08:44:50 -0700
Subject: [PATCH] Change from Test::Stream to Test2
---
lib/Test/More/Prefix.pm | 2 +-
lib/Test/More/Prefix/TB2.pm | 17 ++++++++---------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/lib/Test/More/Prefix.pm b/lib/Test/More/Prefix.pm
index 221204d..01237a9 100644
--- a/lib/Test/More/Prefix.pm
+++ b/lib/Test/More/Prefix.pm
@@ -55,7 +55,7 @@ use Test::More;
sub import {
my ( $class, @args ) = @_;
- if ( $INC{'Test/Stream.pm'} ) {
+ if ( $INC{'Test2/API.pm'} ) {
require Test::More::Prefix::TB2;
Test::More::Prefix::TB2->import(@args);
} else {
diff --git a/lib/Test/More/Prefix/TB2.pm b/lib/Test/More/Prefix/TB2.pm
index 8f39004..ea93f01 100644
--- a/lib/Test/More/Prefix/TB2.pm
+++ b/lib/Test/More/Prefix/TB2.pm
@@ -14,18 +14,17 @@ sub test_prefix {
$prefix = shift();
}
-Test::Stream->shared->munge(
+Test2::API::test2_stack->top->filter(
sub {
- my ( $stream, @e ) = @_;
+ my ( $stream, $e ) = @_;
- for my $e (@e) {
- next unless $prefix;
- next
- unless $e->isa('Test::Stream::Event::Diag')
- || $e->isa('Test::Stream::Event::Note');
+ return $e unless $prefix;
+ return $e unless $e->isa('Test2::Event::Diag')
+ || $e->isa('Test2::Event::Note');
- $e->set_message( "$prefix: " . $e->message );
- }
+ $e->set_message( "$prefix: " . $e->message );
+
+ return $e;
}
);
--
2.7.2