Revision history for Perl extension Catalyst::Model::DBIC::Schema
+0.06 Sat Feb 18 19:05:17 UTC 2006
+ - Fix simple pod-related bug introduced in last rev
+ - Added optional test that uses the helpers
+
0.05 Fri Feb 17 20:52:21 UTC 2006
- Stop showing the template pod in pod tools and cpan,
per Gavin's email.
---
name: Catalyst-Model-DBIC-Schema
-version: 0.05
+version: 0.06
author:
- 'Brandon L Black, C<blblack@gmail.com>'
abstract: DBIx::Class::Schema Model Class
file: lib/Catalyst/Helper/Model/DBIC/SchemaLoader.pm
Catalyst::Model::DBIC::Schema:
file: lib/Catalyst/Model/DBIC/Schema.pm
- version: 0.05
+ version: 0.06
generated_by: Module::Build version 0.2611
--- /dev/null
+use strict;
+use Test::More;
+use FindBin;
+use File::Spec;
+use File::Find;
+
+plan skip_all => 'Enable this optional test with $ENV{C_M_DBIC_SCHEMA_TESTAPP}'
+ unless $ENV{C_M_DBIC_SCHEMA_TESTAPP};
+
+my $test_params = [
+ [ 'TestSchema', 'DBIC::Schema', '' ],
+ [ 'TestSchemaDSN', 'DBIC::Schema', 'fakedsn fakeuser fakepass' ],
+ [ 'TestSchemaLoader', 'DBIC::SchemaLoader', 'fakedsn fakeuser fakepass' ],
+];
+
+plan tests => (2 * @$test_params);
+
+my $test_dir = $FindBin::Bin;
+my $blib_dir = File::Spec->catdir ($test_dir, '..', 'blib', 'lib');
+my $cat_dir = File::Spec->catdir ($test_dir, 'TestApp');
+my $catlib_dir = File::Spec->catdir ($cat_dir, 'lib');
+my $creator = File::Spec->catfile($cat_dir, 'script', 'testapp_create.pl');
+my $model_dir = File::Spec->catdir ($catlib_dir, 'TestApp', 'Model');
+
+chdir($test_dir);
+system("catalyst.pl TestApp");
+chdir($cat_dir);
+
+foreach my $tparam (@$test_params) {
+ my ($model, $helper, $args) = @$tparam;
+ system("$^X -I$blib_dir $creator model $model $helper $model $args");
+ my $model_path = File::Spec->catfile($model_dir, $model . '.pm');
+ ok( -f $model_path, "$model_path is a file" );
+ my $compile_rv = system("$^X -I$blib_dir -I$catlib_dir -c $model_path");
+ ok($compile_rv == 0, "perl -c $model_path");
+}
+
+chdir($test_dir);
+
+sub rm_rf {
+ my $name = $File::Find::name;
+ if(-d $name) { rmdir $name or die "Cannot rmdir $name: $!" }
+ else { unlink $name or die "Cannot unlink $name: $!" }
+}
+finddepth(\&rm_rf, $cat_dir);