X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fschema%2Fclone.t;h=86b7a47d8367bbe9d176dc7afaa3aab4cba9d986;hb=4744c576b5435847d4687727fb768da2958f0831;hp=8bc729fb463c9e5cda6246180470e459a6ad2051;hpb=237e9af389b2342587971cb8be5d56fb2bc4c355;p=dbsrgits%2FDBIx-Class.git diff --git a/t/schema/clone.t b/t/schema/clone.t index 8bc729f..86b7a47 100644 --- a/t/schema/clone.t +++ b/t/schema/clone.t @@ -7,7 +7,21 @@ 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;