{ package BlahBlah::Test; use base qw(Test::Class); sub test_object_emit { my ($self, $test_object, $emit_method) = @_; my $ot = output_test->new( $self->current_method ); my $outfile = $ot->openout(); $test_object->$emit_method($outfile); $ot->ok_files_match(); }; sub out1 : Test(tests => 4) { my $self = shift; my $x = new BlahBlah $x->foo(5000); $x->bar(200); $self->test_object_emit($x, "emit"); }; sub out2 : Test(tests => 4) { my $self = shift; my $x = new Fribble $x->ni(12); $self->test_object_emit($x, "super_emit"); }; # ... etc ... }; BlahBlah::Test->runtests;