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