From: Aaron Trevena Date: Fri, 18 Apr 2008 10:32:30 +0000 (+0000) Subject: fixed tests, fixed syntax error in Apache::MVC X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=a212c53b5fa6f60af5c20168bb0f992e5431eed6;p=maypole.git fixed tests, fixed syntax error in Apache::MVC git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@592 48953598-375a-da11-a14b-00016c27c3ee --- 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%]