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   503 use strict;
  27         33  
  27         606  
3 27     27   81 use warnings;
  27         34  
  27         541  
4              
5 27     27   83 use Carp qw/confess croak/;
  27         29  
  27         1116  
6 27     27   92 use Scalar::Util qw/weaken/;
  27         27  
  27         859  
7              
8 27     27   88 use Test::Stream::Plugin qw/import/;
  27         30  
  27         701  
9              
10             use Test::Stream::Workflow(
11 27         204 qw{
12             unimport
13             group_builder
14             gen_unit_builder
15             },
16             group_builder => {-as => 'describe'},
17             group_builder => {-as => 'cases'},
18 27     27   116 );
  27         42  
19              
20             sub load_ts_plugin {
21 27     27 0 45 my $class = shift;
22 27         34 my $caller = shift;
23              
24 27         153 Test::Stream::Workflow::Meta->build(
25             $caller->[0],
26             $caller->[1],
27             $caller->[2],
28             'EOF',
29             );
30              
31 27         89 Test::Stream::Exporter::export_from($class, $caller->[0], \@_);
32             }
33              
34 27     27   118 use Test::Stream::Exporter qw/default_exports/;
  27         64  
  27         195  
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   101 no Test::Stream::Exporter;
  27         43  
  27         81  
46              
47             BEGIN {
48 27     27   137 *tests = gen_unit_builder(name => 'tests', callback => 'simple', stashes => ['primary']);
49 27         90 *it = gen_unit_builder(name => 'it', callback => 'simple', stashes => ['primary']);
50 27         88 *case = gen_unit_builder(name => 'case', callback => 'simple', stashes => ['modify']);
51 27         82 *before_all = gen_unit_builder(name => 'before_all', callback => 'simple', stashes => ['buildup']);
52 27         91 *after_all = gen_unit_builder(name => 'after_all', callback => 'simple', stashes => ['teardown']);
53 27         84 *around_all = gen_unit_builder(name => 'around_all', callback => 'simple', stashes => ['buildup', 'teardown']);
54 27         77 *before_case = gen_unit_builder(name => 'before_case', callback => 'modifiers', stashes => ['buildup']);
55 27         81 *after_case = gen_unit_builder(name => 'after_case', callback => 'modifiers', stashes => ['teardown']);
56 27         85 *around_case = gen_unit_builder(name => 'around_case', callback => 'modifiers', stashes => ['buildup', 'teardown']);
57 27         73 *before_each = gen_unit_builder(name => 'before_each', callback => 'primaries', stashes => ['buildup']);
58 27         74 *after_each = gen_unit_builder(name => 'after_each', callback => 'primaries', stashes => ['teardown']);
59 27         118 *around_each = gen_unit_builder(name => 'around_each', callback => 'primaries', stashes => ['buildup', 'teardown']);
60             }
61              
62             1;
63              
64             __END__