Tweaked tt_schema
[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 sub tt_schema { local $/ = undef; \<DATA>; }
13
14 sub tt_vars { ( foo => "bar" ); }
15
16 sub tt_config { ( INTERPOLATE => 1 ); }
17
18 1;
19
20 __DATA__
21 Hello World
22 Tables: [% schema.get_tables %]
23 [% table = schema.get_tables.first -%]
24
25 $table
26 ------
27 Fields: $table.field_names.join