~ubuntu-branches/ubuntu/trusty/libtest-roo-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/ordering.t

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2014-01-14 19:25:11 UTC
  • Revision ID: package-import@ubuntu.com-20140114192511-9ycl4dc1zgamfnek
Tags: upstream-1.002
ImportĀ upstreamĀ versionĀ 1.002

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use 5.008001;
 
2
use Test::More 0.96;
 
3
use Capture::Tiny qw/capture/;
 
4
 
 
5
use lib 't/lib';
 
6
 
 
7
my @cases = (
 
8
    {
 
9
        label  => "main tests",
 
10
        file   => "t/bin/main-order.pl",
 
11
        expect => qr/first_test.*?second_test/ms,
 
12
    },
 
13
    {
 
14
        label  => "role vs main",
 
15
        file   => "t/bin/role-last.pl",
 
16
        expect => qr/in_main.*?in_role/ms,
 
17
    },
 
18
    {
 
19
        label  => "force role first",
 
20
        file   => "t/bin/custom-order.pl",
 
21
        expect => qr/in_role.*?in_main/ms,
 
22
    },
 
23
);
 
24
 
 
25
for my $c (@cases) {
 
26
    my ( $output, $error, $rc ) = capture { system( $^X, $c->{file} ) };
 
27
    subtest $c->{label} => sub {
 
28
        ok( !$rc, "zero exit" );
 
29
        like( $output, $c->{expect}, "expected text" );
 
30
    };
 
31
}
 
32
 
 
33
done_testing;
 
34
#
 
35
# This file is part of Test-Roo
 
36
#
 
37
# This software is Copyright (c) 2013 by David Golden.
 
38
#
 
39
# This is free software, licensed under:
 
40
#
 
41
#   The Apache License, Version 2.0, January 2004
 
42
#
 
43
# vim: ts=4 sts=4 sw=4 et: