X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=t%2F1.t;h=be5e6bdac57f11a880cbf59019bab09e66887d00;hb=0f0ccfbbe2488b34841e5af2ecedd9f256c8489f;hp=bb56b7ab4c1bc9e149c782dfe67df593359b140d;hpb=1b3ec28e5f2b7f6f5f4c8140a98e114912271a53;p=maypole.git diff --git a/t/1.t b/t/1.t index bb56b7a..be5e6bd 100644 --- a/t/1.t +++ b/t/1.t @@ -1,17 +1,15 @@ -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl 1.t' +# vim:ft=perl +use Test::More tests => 5; +use Maypole::CLI qw(BeerDB); +use Maypole::Constants; +$ENV{MAYPOLE_TEMPLATES} = "t/templates"; -######################### +isa_ok( (bless {},"BeerDB") , "Maypole"); -# change 'tests => 1' to 'tests => last_test_to_print'; - -use Test; -BEGIN { plan tests => 1 }; -use Apache::MVC; -ok(1); # If we made it this far, we're ok. - -######################### - -# Insert your test code below, the Test::More module is use()ed here so read -# its man page ( perldoc Test::More ) for help writing this test script. +@ARGV = ("http://localhost/beerdb/"); +is(BeerDB->handler, OK, "OK"); +like($Maypole::CLI::buffer, qr/frontpage/, "Got the front page"); +@ARGV = ("http://localhost/beerdb/beer/list"); +is(BeerDB->handler, OK, "OK"); +like($Maypole::CLI::buffer, qr/Organic Best/, "Found a beer in the list");