Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
2 | |
f30e8593 |
3 | use strict; |
4 | use warnings; |
5 | use Test::More; |
6 | |
c0329273 |
7 | |
f30e8593 |
8 | use DBICTest; |
9 | |
10 | my $schema = DBICTest->init_schema(); |
11 | |
71829446 |
12 | { |
13 | my $clone = $schema->clone; |
14 | cmp_ok ($clone->storage, 'eq', $schema->storage, 'Storage copied into new schema (not a new instance)'); |
15 | } |
16 | |
17 | { |
18 | is $schema->custom_attr, undef; |
19 | my $clone = $schema->clone(custom_attr => 'moo'); |
20 | is $clone->custom_attr, 'moo', 'cloning can change existing attrs'; |
21 | } |
22 | |
23 | { |
24 | my $clone = $schema->clone({ custom_attr => 'moo' }); |
25 | is $clone->custom_attr, 'moo', 'cloning can change existing attrs'; |
26 | } |
27 | |
f30e8593 |
28 | |
29 | done_testing; |