]> git.decadent.org.uk Git - maypole.git/blobdiff - t/01basics.t
Modified setup_model() to load any available custom table classes.
[maypole.git] / t / 01basics.t
index 2b1518dead6a4b6a2d34c9c766d65d83b14bd5d4..e40fa85f488725b000c26b80428cc70012c51779 100644 (file)
@@ -1,4 +1,4 @@
-# vim:ft=perl
+#!/usr/bin/perl -w
 use Test::More;
 use lib 'ex'; # Where BeerDB should live
 BEGIN {
@@ -7,7 +7,7 @@ BEGIN {
         "SQLite not working or BeerDB module could not be loaded: $@"
     ) if $@;
 
-    plan tests => 15;
+    plan tests => 18;
 }
 use Maypole::CLI qw(BeerDB);
 use Maypole::Constants;
@@ -15,8 +15,6 @@ $ENV{MAYPOLE_TEMPLATES} = "t/templates";
 
 isa_ok( (bless {},"BeerDB") , "Maypole");
 
-BeerDB->config->view_options({COMPILE_DIR => '/home/simon/dev/maypole/compiled'});
-
 # Test the effect of trailing slash on config->uri_base and request URI
 (my $uri_base = BeerDB->config->uri_base) =~ s:/$::;
 BeerDB->config->uri_base($uri_base);
@@ -44,3 +42,7 @@ is($classdata{list_columns}, 'score name price style brewery url',
    'classdata.list_columns');
 is ($classdata{related_accessors},'pubs','classdata.related_accessors');
 
+# test if successfully loaded customised model class
+can_ok(BeerDB::Beer => 'fooey');     # defined in BeerDB::Beer
+can_ok(BeerDB::Beer => 'floob');     # defined in BeerDB::Base
+is_deeply( [@BeerDB::Beer::ISA], [qw/Maypole::Model::CDBI Class::DBI::SQLite BeerDB::Base/] );