Detect and very loudly warn about Return::Multilevel in exception_action()
[dbsrgits/DBIx-Class.git] / t / cdbi / columns_dont_override_custom_accessors.t
1 use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7 use lib 't/cdbi/testlib';
8
9 {
10     package Thing;
11
12     use base 'DBIC::Test::SQLite';
13
14     Thing->columns(TEMP => qw[foo bar]);
15     Thing->columns(All  => qw[thing_id yarrow flower]);
16     sub foo { 42 }
17     sub yarrow { "hock" }
18 }
19
20 is_deeply( [sort Thing->columns("TEMP")],
21            [sort qw(foo bar)],
22            "TEMP columns set"
23 );
24 my $thing = Thing->construct(
25     { thing_id => 23, foo => "this", bar => "that" }
26 );
27
28 is( $thing->id, 23 );
29 is( $thing->yarrow, "hock", 'custom accessor not overwritten by column' );
30 is( $thing->foo, 42, 'custom routine not overwritten by temp column' );
31 is( $thing->bar, "that", 'temp column accessor generated' );
32
33 done_testing;