From: Rafael Kitover Date: Thu, 14 Jan 2010 15:30:55 +0000 (+0000) Subject: test for single replicant hashref coercion, release X-Git-Tag: v0.37^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Model-DBIC-Schema.git;a=commitdiff_plain;h=626adb9c4591e540d675d6927903b82515712394;hp=61fed351e2f295ecb63f0c238f50497e42723fbf test for single replicant hashref coercion, release --- diff --git a/Changes b/Changes index 8772d91..bfdbfc3 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension Catalyst::Model::DBIC::Schema +0.37 Thu Jan 14 10:20:43 EST 2010 + - support single replicant hashref from config + 0.36 Thu Jan 14 09:21:10 EST 2010 - upgrading a schema to use_namespaces=1 will also turn on components=InflateColumn::DateTime (the default.) diff --git a/Makefile.PL b/Makefile.PL index eba03a1..44295bf 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -15,7 +15,7 @@ requires 'Carp::Clan'; requires 'List::MoreUtils'; requires 'Tie::IxHash'; -test_requires 'Test::More' => '0.92'; +test_requires 'Test::More' => '0.94'; test_requires 'Test::Exception'; feature 'Catalyst::Helper support', diff --git a/lib/Catalyst/Helper/Model/DBIC/Schema.pm b/lib/Catalyst/Helper/Model/DBIC/Schema.pm index b61e012..c177a30 100644 --- a/lib/Catalyst/Helper/Model/DBIC/Schema.pm +++ b/lib/Catalyst/Helper/Model/DBIC/Schema.pm @@ -4,7 +4,7 @@ use namespace::autoclean; use Moose; no warnings 'uninitialized'; -our $VERSION = '0.36'; +our $VERSION = '0.37'; $VERSION = eval $VERSION; use Carp; diff --git a/lib/Catalyst/Model/DBIC/Schema.pm b/lib/Catalyst/Model/DBIC/Schema.pm index 59447f6..f509af3 100644 --- a/lib/Catalyst/Model/DBIC/Schema.pm +++ b/lib/Catalyst/Model/DBIC/Schema.pm @@ -5,7 +5,7 @@ use mro 'c3'; extends 'Catalyst::Model'; with 'CatalystX::Component::Traits'; -our $VERSION = '0.36'; +our $VERSION = '0.37'; $VERSION = eval $VERSION; use namespace::autoclean; diff --git a/t/07connect_info.t b/t/07connect_info.t index bb5c9ad..519a5ca 100644 --- a/t/07connect_info.t +++ b/t/07connect_info.t @@ -52,8 +52,6 @@ my @invalid = ( { pg_enable_utf8 => 1 }, { AutoCommit => 1 }, { auto_savepoint => 1 }], ); -plan tests => @tests / 2 + @invalid + 1 + 1; - # ignore redefined warnings, and uninitialized warnings from old # ::Storage::DBI::Replicated local $SIG{__WARN__} = sub { @@ -89,6 +87,11 @@ my $m = TryConnectInfos->new( replicants => \@replicants ); +lives_and { + is_deeply(TryConnectInfos->new(replicants => $tests[1])->replicants, + [ $tests[1] ]) +} 'single replicant hashref coerces correctly'; + is_deeply $m->replicants, [ map $tests[$_], grep $_ % 2, 0 .. $#tests ], 'replicant connect_infos coerced correctly'; @@ -101,6 +104,8 @@ is_deeply $m->replicants, [ 'connect_info coerced correctly when defining connection in the schema class'; } +done_testing; + sub instance { Catalyst::Model::DBIC::Schema->new({ schema_class => 'ASchemaClass',