my $self = shift;
if($_[-1] && ref $_[-1] eq 'HASH') {
- for my $option (qw/ loader_class loader_options /) {
+ for my $option (qw/ loader_class loader_options result_base_class schema_base_class/) {
if(my $value = delete $_[-1]->{$option}) {
$self->$option($value);
}
unlink($filename);
}
+ my $custom_content = $self->_get_custom_content($class, $filename);
+ $custom_content ||= qq|\n\n# You can replace this text with custom|
+ . qq| content, and it will be preserved on regeneration|
+ . qq|\n1;\n|;
+
$text .= qq|$_\n|
for @{$self->{_dump_storage}->{$class} || []};
for @{$self->{_ext_storage}->{$class} || []};
# Write out any custom content the user has added
- my $custom_content = $self->_get_custom_content($class, $filename);
-
- $custom_content ||= qq|\n\n# You can replace this text with custom|
- . qq| content, and it will be preserved on regeneration|
- . qq|\n1;\n|;
-
print $fh $custom_content;
close($fh)
$^O eq 'MSWin32'
? plan(skip_all => "ActiveState perl produces additional warnings, and this test uses unix paths")
- : plan(tests => 143);
+ : plan(tests => 145);
my $DUMP_PATH = './t/_dump';
sub dump_dbicdump {
my %tdata = @_;
- my @cmd = qw(./script/dbicdump);
+ # use $^X so we execute ./script/dbicdump with the same perl binary that the tests were executed with
+ my @cmd = ($^X, qw(./script/dbicdump));
while (my ($opt, $val) = each(%{ $tdata{options} })) {
push @cmd, '-o', "$opt=$val";
push @cmd, $tdata{classname}, $make_dbictest_db::dsn;
+ # make sure our current @INC gets used by dbicdump
+ local $ENV{PERL5LIB} = join ":", @INC, $ENV{PERL5LIB};
+
my ($in, $out, $err);
my $pid = open3($in, $out, $err, @cmd);
--- /dev/null
+package My::ResultBaseClass;
+use base 'DBIx::Class';
+1;
--- /dev/null
+package My::SchemaBaseClass;
+use base 'DBIx::Class::Schema';
+1;