Skip to content

Instantly share code, notes, and snippets.

@tsucchi
Created February 10, 2016 03:02
Show Gist options
  • Select an option

  • Save tsucchi/c1ecf491c312eb014d95 to your computer and use it in GitHub Desktop.

Select an option

Save tsucchi/c1ecf491c312eb014d95 to your computer and use it in GitHub Desktop.
use Scope::Guard;
sub teardown {
#... ここに teardown でやりたい終了処理を入れる
}
sub startup {
#... ここに startup でやりたい初期化処理を入れる
return Scope::Guard->new(\&teardown);
}
subtest 'テストケース1', sub {
my $guard = startup();
#...以下テストケースを実施
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment