Promote resolve_relationship_condition to a 1st-class API method
[dbsrgits/DBIx-Class.git] / xt / extra / diagnostics / incomplete_reregister.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 # things will die if this is set
4 BEGIN { $ENV{DBIC_ASSERT_NO_ERRONEOUS_METAINSTANCE_USE} = 0 }
5
6 use strict;
7 use warnings;
8
9 use Test::More;
10 use Test::Warn;
11
12 use DBICTest;
13
14 my $s = DBICTest->init_schema( no_deploy => 1 );
15
16
17 warnings_exist {
18   DBICTest::Schema::Artist->add_column("somethingnew");
19   $s->unregister_source("Artist");
20   $s->register_class( Artist => "DBICTest::Schema::Artist" );
21 }
22   qr/The ResultSource instance you just registered on .+ \Qas 'Artist' seems to have no relation to DBICTest::Schema->source('Artist') which in turn is marked stale/,
23   'Expected warning on incomplete re-register of schema-class-level source'
24 ;
25
26 done_testing;