File: startup_that_dies.t

package info (click to toggle)
libtest-class-perl 0.35-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 476 kB
  • ctags: 102
  • sloc: perl: 1,668; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 575 bytes parent folder | download | duplicates (5)
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 

use strict;
use warnings;

{
    package StartMethodThatDies;
    use base qw(Test::Class);
    use Test::More;

    sub startup_that_dies : Test( startup ) { die "oops!\n" }

    sub my_test_method : Tests {
        fail('should be skipped because of the startup exception');
    }
}

use Test::Builder::Tester tests => 1;

test_out("not ok 1 - startup_that_dies died (oops!)");
test_fail( +2 );
test_err( "#   (in StartMethodThatDies->startup_that_dies)" );
Test::Class->runtests;
test_test("exception in startup method causes all tests to be skipped");