| 1 | package Poet::t::Util; | ||
| 2 | 1 | $Poet::t::Util::VERSION = '0.16'; | |
| 3 | 1 | ▶ | use Test::Class::Most parent => 'Poet::Test::Class'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use Poet::Tools qw(read_file); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Poet::Util::Debug qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Capture::Tiny qw(capture_stderr); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | my $poet = __PACKAGE__->initialize_temp_env( conf => { layer => 'development' } ); | |
| 9 | |||
| 10 | 1 | ▶ | sub test_debug : Tests { |
|
Subroutine
test_debug: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 11 | 1 | my $data = { foo => 5, bar => 6 }; | |
| 12 | 1 | my $expect = qr|\[d. at .* line .*\] \[\d+\] \{\n bar => 6,\n foo => 5\n\}|; | |
| 13 | |||
| 14 | 1 | ▶ | throws_ok { dd($data) } $expect, "dd"; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 15 | 1 | like( dh($data), $expect, "dh" ); | |
| 16 | 1 | ▶ | like( capture_stderr { dp($data) }, $expect, "dp" ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | 1 | my $console_log = $poet->logs_path("console.log"); | |
| 19 | 1 | ok( !-f $console_log, "no console log" ); | |
| 20 | 1 | dc($data); | |
| 21 | 1 | like( read_file($console_log), qr|$expect|, "dc" ); | |
| 22 | 1 | ▶ | } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | |||
| 24 | 1 | 1; | |