X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fextra%2Fsqlite_view_deps.t;fp=t%2F105view_deps.t;h=39bb632523f348fe5c2f8b2cf09519e1fcf35336;hb=26c663f123032941cb3f61d6cd11869b86716d6d;hp=bf470befe4b6b31d14bffc42aeb141902a030896;hpb=0bec44d5d7af72fd110ab6bff067f865f34db5d0;p=dbsrgits%2FDBIx-Class.git diff --git a/t/105view_deps.t b/xt/extra/sqlite_view_deps.t similarity index 83% rename from t/105view_deps.t rename to xt/extra/sqlite_view_deps.t index bf470be..39bb632 100644 --- a/t/105view_deps.t +++ b/xt/extra/sqlite_view_deps.t @@ -64,10 +64,16 @@ can_ok( $view, $_ ) for qw/new from deploy_depends_on/; = ViewDepsBad->connect( DBICTest->_database ( quote_char => '"') ); ok( $schema2, 'Connected to ViewDepsBad schema OK' ); + my $lazy_view_validity = !( + $schema2->storage->_server_info->{normalized_dbms_version} + < + 3.009 + ); + #################### DEPLOY2 warnings_exist { $schema2->deploy } - [qr/no such table: main.aba_name_artists/], + [ $lazy_view_validity ? () : qr/no such table: main.aba_name_artists/ ], "Deploying the bad schema produces a warning: aba_name_artists was not created."; #################### DOES ORDERING WORK 2? @@ -97,9 +103,15 @@ can_ok( $view, $_ ) for qw/new from deploy_depends_on/; } grep { !/AbaNameArtistsAnd2010CDsWithManyTracks/ } @{ [ $schema2->sources ] }; + $schema2->storage->dbh->do(q( DROP VIEW "aba_name_artists" )) + if $lazy_view_validity; + throws_ok { $schema2->resultset('AbaNameArtistsAnd2010CDsWithManyTracks')->next } - qr/no such table: aba_name_artists_and_2010_cds_with_many_tracks/, - "Query on AbaNameArtistsAnd2010CDsWithManyTracks throws, because the table does not exist" + qr/no such table: (?:main\.)?aba_name_artists/, + sprintf( + "Query on AbaNameArtistsAnd2010CDsWithManyTracks throws, because the%s view does not exist", + $lazy_view_validity ? ' underlying' : '' + ) ; }