X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F05testapp.t;h=552ef4561fd348e0ae503fcab05bdcb74c598143;hb=1fcd7804144856dad9148ced28e5648f28fb86d1;hp=f8f133ae6640477ae7b6acf5aefdb9f14d9478a5;hpb=bf4bdab65638c0d4aad4e4d21d5d8e8149dc0329;p=catagits%2FCatalyst-Model-DBIC-Schema.git diff --git a/t/05testapp.t b/t/05testapp.t index f8f133a..552ef45 100644 --- a/t/05testapp.t +++ b/t/05testapp.t @@ -113,6 +113,43 @@ foreach my $tparam (@$test_params) { } } +# Test that a moose schema is not detected as a non-moose schema due to an +# errant file. +{ + cleanup_schema(); + + system($^X, "-I$blib_dir", $creator, 'model', + 'TestSchemaDSN', 'DBIC::Schema', 'TestSchemaDSN', + 'create=static', 'dbi:SQLite:testdb.db' + ); + + mkdir "$schema_dir/.svn"; + open my $fh, '>', "$schema_dir/.svn/foo" + or die "Could not open $schema_dir/.svn/foo for writing: $!"; + print $fh "gargle\n"; + close $fh; + + mkdir "$schema_dir/Result/.svn"; + open $fh, '>', "$schema_dir/Result/.svn/foo" + or die "Could not open $schema_dir/Result/.svn/foo for writing: $!"; + print $fh "hlagh\n"; + close $fh; + + system($^X, "-I$blib_dir", $creator, 'model', + 'TestSchemaDSN', 'DBIC::Schema', 'TestSchemaDSN', + 'create=static', 'dbi:SQLite:testdb.db' + ); + + for my $file (result_files()) { + my $code = code_for($file); + + like $code, qr/use Moose;\n/, + 'use_moose detection not confused by version control files'; + like $code, qr/__PACKAGE__->meta->make_immutable;\n/, + 'use_moose detection not confused by version control files'; + } +} + done_testing; sub rm_rf {