]> git.decadent.org.uk Git - maypole.git/blobdiff - t/1.t
Added Maypole::Config, and changed other classes to reflect that.
[maypole.git] / t / 1.t
diff --git a/t/1.t b/t/1.t
index bb56b7ab4c1bc9e149c782dfe67df593359b140d..3aaa0e986c231f345abcb50447cbf82af24a9e44 100644 (file)
--- 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'
-
-#########################
-
-# 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.
-
+# vim:ft=perl
+use Test::More;
+use lib 'ex'; # Where BeerDB should live
+BEGIN { if (eval { require BeerDB }) { 
+            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;
+$ENV{MAYPOLE_TEMPLATES} = "t/templates";
+
+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");