X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frun%2F10auto.tl;h=7c795f40b460e4022b4cdbe0704ebae6f0f4f618;hb=5faa95affd5bb016d0fa81f7f99411ce4db5ff08;hp=d715304186a375097b740b39d4fc3a9a4ca1a198;hpb=3712e4f41b929456d8fad713ca702e4a48e9a940;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/run/10auto.tl b/t/run/10auto.tl index d715304..7c795f4 100644 --- a/t/run/10auto.tl +++ b/t/run/10auto.tl @@ -1,14 +1,19 @@ sub run_tests { +my $schema = shift; -plan tests => 1; +plan tests => 2; -DBICTest->class("Artist")->load_components(qw/PK::Auto::SQLite/); +$schema->class("Artist")->load_components(qw/PK::Auto::SQLite/); + # Should just be PK::Auto but this ensures the compat shim works # add an artist without primary key to test Auto -my $artist = DBICTest->class("Artist")->create( { name => 'Auto' } ); +my $artist = $schema->resultset("Artist")->create( { name => 'Auto' } ); $artist->name( 'Auto Change' ); ok($artist->update, 'update on object created without PK ok'); +my $copied = $artist->copy({ name => 'Don\'t tell the RIAA', artistid => undef }); +is($copied->name, 'Don\'t tell the RIAA', "Copied with PKs ok."); + } 1;