From a212c53b5fa6f60af5c20168bb0f992e5431eed6 Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Fri, 18 Apr 2008 10:32:30 +0000 Subject: [PATCH] fixed tests, fixed syntax error in Apache::MVC git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@592 48953598-375a-da11-a14b-00016c27c3ee --- lib/Apache/MVC.pm | 2 +- t/01basics.t | 8 +++++++- t/templates/custom/classdata | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index 20046a6..0dba642 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -217,7 +217,7 @@ sub redirect_request { $r->ar->status($status); $r->ar->headers_out->set('Location' => $redirect_url); - $r->output('redirecting...

redirecting..

') unless ($r->output) + $r->output('redirecting...

redirecting..

') unless ($r->output); return OK; } diff --git a/t/01basics.t b/t/01basics.t index 6fa0c1e..324bb0b 100644 --- a/t/01basics.t +++ b/t/01basics.t @@ -1,5 +1,6 @@ #!/usr/bin/perl -w use Test::More; +use Data::Dumper; use lib 'examples'; # Where BeerDB should live BEGIN { $ENV{BEERDB_DEBUG} = 0; @@ -32,7 +33,12 @@ like(BeerDB->call_url("http://localhost/beerdb"), qr/frontpage/, "Got frontpage, trailing '/' on uri_base but not request"); like(BeerDB->call_url("http://localhost/beerdb/beer/list"), qr/Organic Best/, "Found a beer in the list"); -my (%classdata)=split /\n/, BeerDB->call_url("http://localhost/beerdb/beer/classdata"); + +my $classdata_page = BeerDB->call_url("http://localhost/beerdb/beer/classdata"); +my (%classdata)=split /\n+/, $classdata_page; +#warn $classdata_page; +#warn Dumper(%classdata); + is ($classdata{plural},'beers','classdata.plural'); is ($classdata{moniker},'beer','classdata.moniker'); like ($classdata{cgi},qr/^HTML::Element/,'classdata.cgi'); diff --git a/t/templates/custom/classdata b/t/templates/custom/classdata index d5f60cc..788e2c7 100644 --- a/t/templates/custom/classdata +++ b/t/templates/custom/classdata @@ -1,18 +1,35 @@ name + [% classmetadata.name %] + table + [% classmetadata.table %] + columns + [% classmetadata.columns.join(' ')%] + list_columns + [% classmetadata.list_columns.join(' ') %] + colnames + [% classmetadata.colnames.abv %] + related_accessors + [% classmetadata.related_accessors.join(' ') %] + moniker + [% classmetadata.moniker %] + plural + [% classmetadata.plural %] + cgi + [% classmetadata.cgi.abv%] -- 2.39.5