Permalink
Browse files

Improved test finding in example.

  • Loading branch information...
1 parent 4936281 commit 029f35d82576b1ea5df53d12b832d7a87c93eec3 @chromatic committed Sep 19, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 examples/Notes/t/notes.t
View
@@ -7,19 +7,19 @@ use Dancer ();
use File::Temp;
use Test::More;
use Plack::Test;
+use Package::Stash;
+use namespace::autoclean;
use HTTP::Request::Common;
exit main();
sub main
{
- my $app = get_app();
+ my $app = get_app();
+ my $stash = Package::Stash->new( __PACKAGE__ );
- for my $test (qw( root index read create store ))
- {
- next unless my $sub = __PACKAGE__->can( 'test_' . $test );
- test_psgi $app, $sub;
- }
+ test_psgi $app, __PACKAGE__->can( $_ )
+ for grep /^test_/, $stash->list_all_symbols( 'CODE' );
done_testing();

0 comments on commit 029f35d

Please sign in to comment.