Delete basicrels tests. Modify run tests to use new syntax. Remove helperrels test...
[dbsrgits/DBIx-Class.git] / t / run / 10auto.tl
index d715304..b108369 100644 (file)
@@ -1,14 +1,22 @@
-sub run_tests {
+use strict;
+use warnings;  
 
-plan tests => 1;
+use Test::More;
+use lib qw(t/lib);
+use DBICTest;
 
-DBICTest->class("Artist")->load_components(qw/PK::Auto::SQLite/);
+my $schema = DBICTest::init_schema();
+
+plan tests => 2;
+
+$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;