release 0.06, fixed pod_to_ignore stuff, added an optional half-decent helper test
Brandon L. Black [Sat, 18 Feb 2006 19:03:47 +0000 (19:03 +0000)]
Changes
MANIFEST
META.yml
lib/Catalyst/Helper/Model/DBIC/Schema.pm
lib/Catalyst/Helper/Model/DBIC/SchemaLoader.pm
lib/Catalyst/Model/DBIC/Schema.pm
t/01use.t
t/04testapp.t [new file with mode: 0644]

diff --git a/Changes b/Changes
index 09436ae..d11d328 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 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.
index 5a39bd6..50c246f 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -10,3 +10,4 @@ README
 t/01use.t
 t/02pod.t
 t/03podcoverage.t
+t/04testapp.t
index f6139a3..4bf22d4 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -1,6 +1,6 @@
 ---
 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
@@ -22,5 +22,5 @@ provides:
     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
index dbbb03c..19ab06a 100644 (file)
@@ -72,10 +72,10 @@ it under the same terms as Perl itself.
 
 1;
 
-=begin pod_to_ignore
-
 __DATA__
 
+=begin pod_to_ignore
+
 __compclass__
 package [% class %];
 
index c2abbe3..2086c04 100644 (file)
@@ -87,10 +87,10 @@ it under the same terms as Perl itself.
 
 1;
 
-=begin pod_to_ignore
-
 __DATA__
 
+=begin pod_to_ignore
+
 __loaderclass__
 package [% loader_class %];
 
@@ -172,3 +172,4 @@ it under the same terms as Perl itself.
 =cut
 
 1;
+
index 3240ffe..baf2a72 100644 (file)
@@ -6,7 +6,7 @@ use NEXT;
 use UNIVERSAL::require;
 use Carp;
 
-our $VERSION = '0.05';
+our $VERSION = '0.06';
 
 __PACKAGE__->mk_classaccessor('composed_schema');
 __PACKAGE__->mk_accessors('schema');
index f0b7457..5c130d8 100644 (file)
--- a/t/01use.t
+++ b/t/01use.t
@@ -1,5 +1,6 @@
 use strict;
-use Test::More tests => 2;
+use Test::More tests => 3;
 
 BEGIN { use_ok('Catalyst::Model::DBIC::Schema') }
 BEGIN { use_ok('Catalyst::Helper::Model::DBIC::Schema') }
+BEGIN { use_ok('Catalyst::Helper::Model::DBIC::SchemaLoader') }
diff --git a/t/04testapp.t b/t/04testapp.t
new file mode 100644 (file)
index 0000000..aff0e23
--- /dev/null
@@ -0,0 +1,45 @@
+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);