From: Mark Addison Date: Thu, 13 May 2004 22:52:42 +0000 (+0000) Subject: Added test for tt_config X-Git-Tag: v0.06~57 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=53ec8b7d633d2f84bbd75dda4ef95168da4cd9f6;p=dbsrgits%2FSQL-Translator.git Added test for tt_config --- diff --git a/t/34tt-base.t b/t/34tt-base.t index 42564d2..3841268 100644 --- a/t/34tt-base.t +++ b/t/34tt-base.t @@ -54,5 +54,8 @@ print $out if DEBUG; __DATA__ Hello World +Tables: Basic + Basic -foo:bar +------ +Fields: id title description email explicitnulldef explicitemptystring emptytagdef diff --git a/t/lib/Producer/BaseTest.pm b/t/lib/Producer/BaseTest.pm index bc97aab..a8cfe01 100644 --- a/t/lib/Producer/BaseTest.pm +++ b/t/lib/Producer/BaseTest.pm @@ -1,5 +1,9 @@ package Producer::BaseTest; +# +# A trivial little sub-class to test sub-classing the TT::Base producer. +# + use base qw/SQL::Translator::Producer::TT::Base/; # Make sure we use our new class as the producer @@ -9,9 +13,15 @@ sub tt_schema { local $/ = undef; return \; } sub tt_vars { ( foo => "bar" ); } +sub tt_config { ( INTERPOLATE => 1 ); } + 1; __DATA__ Hello World -[% schema.get_tables %] -foo:bar +Tables: [% schema.get_tables %] +[% table = schema.get_tables.first -%] + +$table +------ +Fields: $table.field_names.join