a31c682c606e29ded29208bd20ff2a4f1dd7fe24
[dbsrgits/SQL-Translator.git] / t / lib / Producer / BaseTest.pm
1 package Producer::BaseTest;
2
3 #
4 # A trivial little sub-class to test sub-classing the TT::Base producer.
5 #
6
7 use base qw/SQL::Translator::Producer::TT::Base/;
8
9 # Make sure we use our new class as the producer
10 sub produce { return __PACKAGE__->new( translator => shift )->run; };
11
12 # Note: we don't need to impliment tt_schema as the default will use the DATA
13 # section by default.
14
15 sub tt_vars { ( foo => "bar" ); }
16
17 sub tt_config { ( INTERPOLATE => 1 ); }
18
19 1;
20
21 __DATA__
22 Hello World
23 Tables: [% schema.get_tables %]
24 [% table = schema.get_tables.first -%]
25
26 $table
27 ------
28 Fields: $table.field_names.join