X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=t%2F1.t;h=77c1f9fdef874ff5a28d60a76fc46e2acdebd91b;hb=fb48746a79e660e7f5df5a22269ca9e22519eaa5;hp=ff8ae7347db6a2b5f7a7e566147f96803dde4f69;hpb=feefb416b3c1aafdea07aa47378d007ee760e9f9;p=maypole.git diff --git a/t/1.t b/t/1.t index ff8ae73..77c1f9f 100644 --- a/t/1.t +++ b/t/1.t @@ -1,23 +1,14 @@ # vim:ft=perl -use Test::More 'no_plan'; +use Test::More tests => 5; +use Maypole::CLI qw(BeerDB); +$ENV{MAYPOLE_TEMPLATES} = "t/templates"; -package Fake::Loader; +isa_ok( (bless {},"BeerDB") , "Maypole"); -package Fake::MVC; -use base 'Apache::MVC'; +@ARGV = ("http://localhost/beerdb/"); +is(BeerDB->handler, 200, "OK"); +like($Maypole::CLI::buffer, qr/frontpage/, "Got the front page"); -sub set_database { - my $self = shift; - $self->config->{loader} = bless {}, Fake::Loader; -} - -sub get_request {} - -sub parse_location { - my $self = shift; - my @pi = @Fake::MVC::url; - shift @pi while @pi and !$pi[0]; - $self->{table} = shift @pi; - $self->{action} = shift @pi; - $self->{args} = \@pi; -} +@ARGV = ("http://localhost/beerdb/beer/list"); +is(BeerDB->handler, 200, "OK"); +like($Maypole::CLI::buffer, qr/Organic Best/, "Found a beer in the list");