File: show_plan_in_shutdown.t

package info (click to toggle)
libtest-class-perl 0.52-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 540 kB
  • sloc: perl: 1,706; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /usr/bin/perl -T

use strict;
use warnings FATAL => 'all';
use Test::More;

my $shutdown_has_run;

{   package My::Test;
    use base qw( Test::Class );
    use Test::More;
    
    sub shutdown :Test( shutdown ) {
        $shutdown_has_run = 1;
    }
    
    sub test : Test {
        pass "passing test to force shutdown method to run";
    } 
    
}

My::Test->runtests( +1 );
ok $shutdown_has_run, "shutdown method has run";