Skip to content

Commit

Permalink
Testing setup/teardown with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianh committed Mar 28, 2009
1 parent 9795b50 commit 1f01bfb
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion examples/nested.pl
Expand Up @@ -9,6 +9,8 @@

use Test::Class '0.32_2';

$ENV{ TEST_VERBOSE } = 1;

{ package SimplePassAndFail;
use base qw( Test::Class );
use Test::More;
Expand All @@ -27,7 +29,7 @@

}

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

Expand All @@ -49,5 +51,27 @@

}

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

sub setup :Test( setup => 1 ) {
pass "in setup";
}

sub teardown :Test( teardown => 1 ) {
pass "in teardown";
}

sub this_should_pass :Test {
pass "alpha";
}

sub this_should_fail :Test {
fail "beta";
}

}

Test::Class->runtests;
print "done\n";

0 comments on commit 1f01bfb

Please sign in to comment.