From d0870933fcb803bac8e31a30b785d1dff15c5278 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Tue, 6 Apr 2004 11:23:47 +0000 Subject: [PATCH] Fix up example module, skip test if no SQLite. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@119 48953598-375a-da11-a14b-00016c27c3ee --- ex/BeerDB.pm | 8 ++++---- t/1.t | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ex/BeerDB.pm b/ex/BeerDB.pm index b7961bc..f7a9690 100644 --- a/ex/BeerDB.pm +++ b/ex/BeerDB.pm @@ -4,12 +4,12 @@ use Class::DBI::Loader::Relationship; # This is the sample application. Change this to the path to your # database. (or use mysql or something) -#BeerDB->set_database("dbi:SQLite:t/beerdb.db"); -BeerDB->setup("dbi:mysql:beerdb"); +BeerDB->setup("dbi:SQLite:t/beerdb.db"); +#BeerDB->setup("dbi:mysql:beerdb"); # Change this to the root of the web space. -#BeerDB->config->{uri_base} = "http://localhost/beerdb/"; -BeerDB->config->{uri_base} = "http://neo.trinity-house.org.uk/beerdb/"; +BeerDB->config->{uri_base} = "http://localhost/beerdb/"; +#BeerDB->config->{uri_base} = "http://neo.trinity-house.org.uk/beerdb/"; BeerDB->config->{rows_per_page} = 10; diff --git a/t/1.t b/t/1.t index be5e6bd..50aa24c 100644 --- a/t/1.t +++ b/t/1.t @@ -1,5 +1,10 @@ # vim:ft=perl -use Test::More tests => 5; +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: $@") } + } use Maypole::CLI qw(BeerDB); use Maypole::Constants; $ENV{MAYPOLE_TEMPLATES} = "t/templates"; -- 2.39.5