X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=t%2F1.t;h=3aaa0e986c231f345abcb50447cbf82af24a9e44;hb=5f530b5f17106319faa2f437a567332c86bf6a2c;hp=50aa24c4d6933994b2903e0db2d1dd045d8f9aa1;hpb=5ba93a09518403ae28e8a71b5299e2458a6dfa0b;p=maypole.git diff --git a/t/1.t b/t/1.t index 50aa24c..3aaa0e9 100644 --- a/t/1.t +++ b/t/1.t @@ -2,8 +2,8 @@ use Test::More; use lib 'ex'; # Where BeerDB should live BEGIN { if (eval { require BeerDB }) { - plan tests => 5; - } else { Test::More->import(skip_all =>"SQLite not working or BeerDB module not found: $@") } + plan tests => 3; + } else { Test::More->import(skip_all =>"SQLite not working or BeerDB module could not be loaded: $@") } } use Maypole::CLI qw(BeerDB); use Maypole::Constants; @@ -11,10 +11,5 @@ $ENV{MAYPOLE_TEMPLATES} = "t/templates"; isa_ok( (bless {},"BeerDB") , "Maypole"); -@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"); +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");