X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=t%2F01basics.t;h=9c3d4b9531cbcf6d05a972e85d4fe00af2d7c206;hb=8f6d0577a304bb99d072c9eaf707ab278927bb09;hp=3aaa0e986c231f345abcb50447cbf82af24a9e44;hpb=fdb1043b4260053234d48abc51d3838a2f74d957;p=maypole.git diff --git a/t/01basics.t b/t/01basics.t index 3aaa0e9..9c3d4b9 100644 --- a/t/01basics.t +++ b/t/01basics.t @@ -2,7 +2,7 @@ use Test::More; use lib 'ex'; # Where BeerDB should live BEGIN { if (eval { require BeerDB }) { - plan tests => 3; + plan tests => 12; } else { Test::More->import(skip_all =>"SQLite not working or BeerDB module could not be loaded: $@") } } use Maypole::CLI qw(BeerDB); @@ -13,3 +13,16 @@ isa_ok( (bless {},"BeerDB") , "Maypole"); like(BeerDB->call_url("http://localhost/beerdb/"), qr/frontpage/, "Got the front page"); 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"); +is ($classdata{plural},'beers','classdata.plural'); +is ($classdata{moniker},'beer','classdata.moniker'); +like ($classdata{cgi},qr/^HTML::Element/,'classdata.cgi'); +is ($classdata{table},'beer','classdata.table'); +is ($classdata{name},'BeerDB::Beer','classdata.name'); +is ($classdata{colnames},'Abv','classdata.colnames'); +is($classdata{columns}, 'abv brewery id name notes price score style url', + 'classdata.columns'); +is($classdata{list_columns}, 'score name price style brewery url', + 'classdata.list_columns'); +is ($classdata{related_accessors},'pubs','classdata.related_accessors'); +