X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frun%2F01core.tl;h=5d040010213dbd9f5218cc9634d850d549339625;hb=fed966517e558cfc9ee505d44add2d04e77a7d3d;hp=9ef60a0715ed98caa2cd6cd4ba3c9875c4e7e6c8;hpb=4d1c49b8641f79bfe316e018d127848966616a08;p=dbsrgits%2FDBIx-Class.git diff --git a/t/run/01core.tl b/t/run/01core.tl index 9ef60a0..5d04001 100644 --- a/t/run/01core.tl +++ b/t/run/01core.tl @@ -1,7 +1,7 @@ sub run_tests { my $schema = shift; -plan tests => 44; +plan tests => 49; # figure out if we've got a version of sqlite that is older than 3.2.6, in # which case COUNT(DISTINCT()) doesn't work @@ -194,6 +194,21 @@ is($typeinfo->{data_type}, 'INTEGER', 'column_info ok'); $schema->source("Artist")->column_info('artistid'); ok($schema->source("Artist")->{_columns_info_loaded} == 1, 'Columns info flag set'); +# source_name should be set for normal modules +is($schema->source('CD')->source_name, 'CD', 'source_name is set to moniker'); + +# test the result source that uses source_name +ok($schema->source('SourceNameArtists'), 'SourceNameArtists result source exists'); + +my @artsn = $schema->resultset("SourceNameArtists")->search({ }, { order_by => 'name DESC'}); +cmp_ok(@artsn, '==', 4, "Four artists returned"); + + +# test removed columns +is_deeply([$schema->source('CD')->columns], [qw/cdid artist title year/]); +$schema->source('CD')->remove_columns('year'); +is_deeply([$schema->source('CD')->columns], [qw/cdid artist title/]); + } 1;