From: Sebastian Riedel Date: Thu, 3 Mar 2005 20:11:12 +0000 (+0000) Subject: pod coverage test for helper generated apps X-Git-Tag: 5.7099_04~1784 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=1df125c95d52bba7c3e2f5d01337c98e50172a7b pod coverage test for helper generated apps --- diff --git a/Changes b/Changes index eb420c2..8e2b31f 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ This file documents the revision history for Perl extension Catalyst. 4.13 Thu Mar 03 11:00:00 2005 - improved documentation + - pod coverage test for helper generated apps 4.12 Wed Mar 02 11:00:00 2005 - server_base sucks, removed diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index d50fb16..d4fd807 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -150,6 +150,17 @@ use_ok( Catalyst::Test, '$name' ); ok( request('/')->is_success ); EOF + my $pc = IO::File->new("> $t/02podcoverage.t") + or die qq/Couldn't open "$t\/02podcoverage.t", "$!"/; + print $pc <<"EOF"; +use Test::More; + +eval "use Test::Pod::Coverage 1.04"; +plan skip_all => 'Test::Pod::Coverage 1.04 required' if \$@; +plan skip_all => 'set TEST_POD to enable this test' unless \$ENV{TEST_POD}; + +all_pod_coverage_ok(); +EOF } sub _mk_server { diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index 2bf2840..9f8b0eb 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -68,7 +68,7 @@ Just use Catalyst::Model::CDBI::CRUD as baseclass. Modify the $c->form() parameters to match your needs, and don't forget to copy the templates. ;) -=head2 Serving static files and CSS as text/css +==head2 Serving static files and CSS as text/css If you want to serve static content (like images, txt or CSS) via Catalyst, then all you need is the plugin Catalyst::Plugin::Static as well as a small @@ -93,7 +93,7 @@ regex to set the MIME type for CSS to text/css. }, ); -=head2 Uploads with Catalyst +==head2 Uploads with Catalyst To implement uploads in Catalyst you need to have a HTML form similiar to this: @@ -135,34 +135,6 @@ module: $CGI::Simple::POST_MAX = 1048576000; - -=head2 Easily working with datetime objects. - -If you store datetime data in your tables, you can easily expand this column to -a L object which lets you call useful methods like ymd, mon and -datetime on it. - -In order to set it up, add something like the following to your CDBI Model Class, -if you are storing dates as ISO timestamps: - - __PACKAGE__->has_a( - mycolumn => 'Time::Piece', - inflate => sub { Time::Piece->strptime( shift, "%FT%H:%M:%S" ) }, - deflate => 'datetime' - ); - -or if you prefer to store dates in unix epoch time you can do something like this: - - __PACKAGE__->has_a( - mycolumn => 'Time::Piece', - inflate => sub { Time::Piece->strptime( shift, "%s" ) }, - deflate => 'epoch' - ); - -If you want to use another format in the database, you can change the strptime call -to fit your format, and use strftime to return it with your custom format to the -database during deflate. See the L and L docs for more info. - =head1 AUTHOR Sebastian Riedel, C diff --git a/t/12default.t b/t/12default.t index d7cc040..18d9884 100644 --- a/t/12default.t +++ b/t/12default.t @@ -23,5 +23,5 @@ package main; use Test::More tests => 2; use Catalyst::Test 'TestApp'; -like( get('/foo') , qr/bar/ ); -like( get('/foo_bar/foo') , qr/yada/ ); +ok( get('/foo') =~ /bar/ ); +ok( get('/foo_bar/foo') =~ /yada/ );