3
use Capture::Tiny qw/capture/;
9
label => "missing role",
10
file => "t/bin/role-not-found.pl",
11
expect => qr/Can't \S+ RoleNotFoundAnywhere\.pm in \@INC/,
14
label => "requires not satisfied",
15
file => "t/bin/unsatisfied.pl",
16
expect => qr/Can't apply RequiresFixture to main/,
19
label => "Test::Roo loads strictures",
20
file => "t/bin/not-strict.pl",
21
expect => qr/requires explicit package name/,
24
label => "skip_all respected",
25
file => "t/bin/skip-all.pl",
26
expect => qr/We just want to skip/,
31
label => "skip_all respected in role",
32
file => "t/bin/skip-in-role.pl",
33
expect => qr/We just want to skip/,
40
my ( $output, $error, $rc ) = capture { system( $^X, $c->{file} ) };
41
subtest $c->{label} => sub {
42
if ( $c->{exit_ok} ) {
43
ok( !$rc, "exit ok" );
46
ok( $rc, "nonzero exit" );
48
like( $c->{stdout} ? $output : $error, $c->{expect}, "exception text" );
54
# This file is part of Test-Roo
56
# This software is Copyright (c) 2013 by David Golden.
58
# This is free software, licensed under:
60
# The Apache License, Version 2.0, January 2004
62
# vim: ts=4 sts=4 sw=4 et: