X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fschema%2Fclone.t;h=877da18e5b7ea446cfb2791167471310c40d482f;hb=c0329273268971824784f239f32c7246e68da9c5;hp=8bc729fb463c9e5cda6246180470e459a6ad2051;hpb=237e9af389b2342587971cb8be5d56fb2bc4c355;p=dbsrgits%2FDBIx-Class.git diff --git a/t/schema/clone.t b/t/schema/clone.t index 8bc729f..877da18 100644 --- a/t/schema/clone.t +++ b/t/schema/clone.t @@ -1,13 +1,29 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); -my $clone = $schema->clone; -cmp_ok ($clone->storage, 'eq', $schema->storage, 'Storage copied into new schema (not a new instance)'); +{ + my $clone = $schema->clone; + cmp_ok ($clone->storage, 'eq', $schema->storage, 'Storage copied into new schema (not a new instance)'); +} + +{ + is $schema->custom_attr, undef; + my $clone = $schema->clone(custom_attr => 'moo'); + is $clone->custom_attr, 'moo', 'cloning can change existing attrs'; +} + +{ + my $clone = $schema->clone({ custom_attr => 'moo' }); + is $clone->custom_attr, 'moo', 'cloning can change existing attrs'; +} + done_testing;