]> git.decadent.org.uk Git - maypole.git/blob - t/1.t
50aa24c4d6933994b2903e0db2d1dd045d8f9aa1
[maypole.git] / t / 1.t
1 # vim:ft=perl
2 use Test::More;
3 use lib 'ex'; # Where BeerDB should live
4 BEGIN { if (eval { require BeerDB }) { 
5             plan tests => 5;
6         } else { Test::More->import(skip_all =>"SQLite not working or BeerDB module not found: $@") }
7       }
8 use Maypole::CLI qw(BeerDB);
9 use Maypole::Constants;
10 $ENV{MAYPOLE_TEMPLATES} = "t/templates";
11
12 isa_ok( (bless {},"BeerDB") , "Maypole");
13
14 @ARGV = ("http://localhost/beerdb/");
15 is(BeerDB->handler, OK, "OK");
16 like($Maypole::CLI::buffer, qr/frontpage/, "Got the front page");
17
18 @ARGV = ("http://localhost/beerdb/beer/list");
19 is(BeerDB->handler, OK, "OK");
20 like($Maypole::CLI::buffer, qr/Organic Best/, "Found a beer in the list");