| 1 | # | ||||||||||
| 2 | # This file is part of Template-Plugin-TwoStage | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is copyright (c) 2014 by Alexander Kühne. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||
| 8 | # | ||||||||||
| 9 | package # hide from pause | ||||||||||
| 10 | Template::Plugin::TwoStage::Test; | ||||||||||
| 11 | # ABSTRACT: derived class for self-tests only | ||||||||||
| 12 | |||||||||||
| 13 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 5 | ▶ | use base qw( Template::Plugin::TwoStage ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 5 | ▶ | use File::Temp 'tempdir'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 5 | ▶ | use Cwd (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | 5 | Template::Plugin::TwoStage->caching_dir( tempdir( "TT_P_TwoStage_XXXXXX", TMPDIR => 1, CLEANUP => 1 ) ); | |||||||||
| 20 | 5 | __PACKAGE__->caching_dir( tempdir( "TT_P_TwoStage_XXXXXX", TMPDIR => 1, CLEANUP => 1 ) ); | |||||||||
| 21 | |||||||||||
| 22 | |||||||||||
| 23 | 3 | ▶ | sub read_test_file { | ||||||||
|
Subroutine
read_test_file: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 24 | 3 | my ( $class, $test_file ) = @_; | |||||||||
| 25 | 3 | local $/; | |||||||||
| 26 | 3 | ▶ | open( my $fh, "<", Template::Plugin::TwoStage::_concat_path( Cwd::cwd(), [ 't', $test_file ] ) ) or die $!; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 3 | my $tests = <$fh>; | |||||||||
| 28 | 3 | close $fh; | |||||||||
| 29 | 3 | $tests; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | |||||||||||
| 33 | 5 | ▶ | sub tt_config { | ||||||||
|
Subroutine
tt_config: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 34 | 5 | my ( $class, $config ) = @_; | |||||||||
| 35 | |||||||||||
| 36 | return( | ||||||||||
| 37 | { INCLUDE_PATH => [ Template::Plugin::TwoStage::_concat_path( Cwd::cwd(), [ 't', 'tt' ] ) ], | ||||||||||
| 38 | POST_CHOMP => 1, | ||||||||||
| 39 | PLUGIN_BASE => 'Template::Plugin', | ||||||||||
| 40 | EVAL_PERL => 1, | ||||||||||
| 41 | 5 | ▶ | ( defined $config ? %{$config} : () ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | } | ||||||||||
| 43 | ); | ||||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | |||||||||||
| 47 | 5 | 1; | |||||||||
| 48 | |||||||||||
| 49 | __END__ | ||||||||||