From: Brandon L. Black Date: Sat, 18 Feb 2006 19:03:47 +0000 (+0000) Subject: release 0.06, fixed pod_to_ignore stuff, added an optional half-decent helper test X-Git-Tag: v0.12~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d11d759b2ed5340a2f8da9e8cdd1ae8aab52be7;hp=c919d0bc6e46ebe614eacd635eb4c146301d640c;p=catagits%2FCatalyst-Model-DBIC-Schema.git release 0.06, fixed pod_to_ignore stuff, added an optional half-decent helper test --- diff --git a/Changes b/Changes index 09436ae..d11d328 100644 --- 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. diff --git a/MANIFEST b/MANIFEST index 5a39bd6..50c246f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -10,3 +10,4 @@ README t/01use.t t/02pod.t t/03podcoverage.t +t/04testapp.t diff --git a/META.yml b/META.yml index f6139a3..4bf22d4 100644 --- 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' 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 diff --git a/lib/Catalyst/Helper/Model/DBIC/Schema.pm b/lib/Catalyst/Helper/Model/DBIC/Schema.pm index dbbb03c..19ab06a 100644 --- a/lib/Catalyst/Helper/Model/DBIC/Schema.pm +++ b/lib/Catalyst/Helper/Model/DBIC/Schema.pm @@ -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 %]; diff --git a/lib/Catalyst/Helper/Model/DBIC/SchemaLoader.pm b/lib/Catalyst/Helper/Model/DBIC/SchemaLoader.pm index c2abbe3..2086c04 100644 --- a/lib/Catalyst/Helper/Model/DBIC/SchemaLoader.pm +++ b/lib/Catalyst/Helper/Model/DBIC/SchemaLoader.pm @@ -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; + diff --git a/lib/Catalyst/Model/DBIC/Schema.pm b/lib/Catalyst/Model/DBIC/Schema.pm index 3240ffe..baf2a72 100644 --- a/lib/Catalyst/Model/DBIC/Schema.pm +++ b/lib/Catalyst/Model/DBIC/Schema.pm @@ -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'); diff --git a/t/01use.t b/t/01use.t index f0b7457..5c130d8 100644 --- 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 index 0000000..aff0e23 --- /dev/null +++ b/t/04testapp.t @@ -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);