X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100extra_source.t;h=05d99b91e455ee1085d9c1280d51fa4091cbd52b;hb=ba42e08cae27496c32d44d3987ac566099140aaf;hp=ac922099d38c072fc5b520a6d348ff8a4f8f4bcb;hpb=2a4d9487f09d04cde419d6840e06b9be5a880a23;p=dbsrgits%2FDBIx-Class.git diff --git a/t/100extra_source.t b/t/100extra_source.t index ac92209..05d99b9 100644 --- a/t/100extra_source.t +++ b/t/100extra_source.t @@ -12,7 +12,7 @@ use DBICTest; use base qw/DBIx::Class::ResultSource::Table/; } -plan tests => 3; +plan tests => 4; my $schema = DBICTest->init_schema(); my $artist_source = $schema->source('Artist'); @@ -26,7 +26,7 @@ my $new_source = DBICTest::ResultSource::OtherSource->new({ $new_source->add_column('other_col' => { data_type => 'integer', default_value => 1 }); my $warn = ''; -$SIG{__WARN__} = sub { $warn = shift }; +local $SIG{__WARN__} = sub { $warn = shift }; { $schema->register_extra_source( 'artist->extra' => $new_source ); @@ -36,6 +36,12 @@ $SIG{__WARN__} = sub { $warn = shift }; } { + my $source = $schema->source('DBICTest::Artist'); + $schema->register_source($source->source_name, $source); + is($warn, '', "re-registering an existing source under the same name causes no errors"); +} + +{ my $new_source_name = 'Artist->preview(artist_preview)'; $schema->register_source( $new_source_name => $new_source );