File Coverage

blib/lib/Test/Stream/Plugin/Spec.pm
Criterion Covered Total %
statement 40 40 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod 0 1 0.0
total 50 51 98.0


line stmt bran cond sub pod time code
1             package Test::Stream::Plugin::Spec;
2 27     27   864 use strict;
  27         52  
  27         671  
3 27     27   137 use warnings;
  27         48  
  27         728  
4              
5 27     27   129 use Carp qw/confess croak/;
  27         52  
  27         1509  
6 27     27   135 use Scalar::Util qw/weaken/;
  27         54  
  27         1096  
7              
8 27     27   144 use Test::Stream::Plugin;
  27         59  
  27         173  
9              
10             use Test::Stream::Workflow(
11 27         260 qw{
12             unimport
13             group_builder
14             gen_unit_builder
15             },
16             group_builder => {-as => 'describe'},
17             group_builder => {-as => 'cases'},
18 27     27   174 );
  27         58  
19              
20             sub load_ts_plugin {
21 27     27 0 71 my $class = shift;
22 27         57 my $caller = shift;
23              
24 27         238 Test::Stream::Workflow::Meta->build(
25             $caller->[0],
26             $caller->[1],
27             $caller->[2],
28             'EOF',
29             );
30              
31 27         151 Test::Stream::Exporter::export_from($class, $caller->[0], \@_);
32             }
33              
34 27     27   166 use Test::Stream::Exporter qw/default_exports/;
  27         117  
  27         199  
35             default_exports qw{
36             describe cases
37             before_all after_all around_all
38              
39             tests it
40             before_each after_each around_each
41              
42             case
43             before_case after_case around_case
44             };
45 27     27   149 no Test::Stream::Exporter;
  27         58  
  27         136  
46              
47             BEGIN {
48 27     27   180 *tests = gen_unit_builder(name => 'tests', callback => 'simple', stashes => ['primary']);
49 27         130 *it = gen_unit_builder(name => 'it', callback => 'simple', stashes => ['primary']);
50 27         157 *case = gen_unit_builder(name => 'case', callback => 'simple', stashes => ['modify']);
51 27         118 *before_all = gen_unit_builder(name => 'before_all', callback => 'simple', stashes => ['buildup']);
52 27         134 *after_all = gen_unit_builder(name => 'after_all', callback => 'simple', stashes => ['teardown']);
53 27         133 *around_all = gen_unit_builder(name => 'around_all', callback => 'simple', stashes => ['buildup', 'teardown']);
54 27         119 *before_case = gen_unit_builder(name => 'before_case', callback => 'modifiers', stashes => ['buildup']);
55 27         126 *after_case = gen_unit_builder(name => 'after_case', callback => 'modifiers', stashes => ['teardown']);
56 27         118 *around_case = gen_unit_builder(name => 'around_case', callback => 'modifiers', stashes => ['buildup', 'teardown']);
57 27         118 *before_each = gen_unit_builder(name => 'before_each', callback => 'primaries', stashes => ['buildup']);
58 27         129 *after_each = gen_unit_builder(name => 'after_each', callback => 'primaries', stashes => ['teardown']);
59 27         143 *around_each = gen_unit_builder(name => 'around_each', callback => 'primaries', stashes => ['buildup', 'teardown']);
60             }
61              
62             1;
63              
64             __END__