Initial stab at a section on building producers with TT::Base
[dbsrgits/SQL-Translator.git] / t / lib / Producer / BaseTest.pm
CommitLineData
f5f03b78 1package Producer::BaseTest;
2
53ec8b7d 3#
4# A trivial little sub-class to test sub-classing the TT::Base producer.
5#
6
f5f03b78 7use base qw/SQL::Translator::Producer::TT::Base/;
8
9# Make sure we use our new class as the producer
10sub produce { return __PACKAGE__->new( translator => shift )->run; };
11
ce48bfec 12sub tt_schema { local $/ = undef; \<DATA>; }
f5f03b78 13
14sub tt_vars { ( foo => "bar" ); }
15
53ec8b7d 16sub tt_config { ( INTERPOLATE => 1 ); }
17
f5f03b78 181;
19
20__DATA__
21Hello World
53ec8b7d 22Tables: [% schema.get_tables %]
23[% table = schema.get_tables.first -%]
24
25$table
26------
27Fields: $table.field_names.join