Fixes to CDBICompat::HasMany mapping method support, with thanks to bricas
[dbsrgits/DBIx-Class-Historic.git] / t / 01core.t
index 20090c0..5ccdd40 100644 (file)
@@ -1,6 +1,6 @@
 use Test::More;
 
-plan tests => 22;
+plan tests => 23;
 
 use lib qw(t/lib);
 
@@ -34,7 +34,7 @@ $art->delete;
 
 cmp_ok(@art, '==', 2, 'And then there were two');
 
-ok(!$art->in_database, "It knows it's dead");
+ok(!$art->in_storage, "It knows it's dead");
 
 eval { $art->delete; };
 
@@ -44,7 +44,7 @@ is($art->name, 'We Are In Rehab', 'But the object is still live');
 
 $art->insert;
 
-ok($art->in_database, "Re-created");
+ok($art->in_storage, "Re-created");
 
 @art = DBICTest::Artist->search({ });
 
@@ -70,7 +70,7 @@ $new->name('Man With A Spoon');
 
 $new->update;
 
-$new_again = DBICTest::Artist->retrieve(4);
+$new_again = DBICTest::Artist->find(4);
 
 is($new_again->name, 'Man With A Spoon', 'Retrieved correctly');
 
@@ -84,9 +84,13 @@ $new = DBICTest::Track->new( {
   title => 'Insert or Update',
 } );
 $new->insert_or_update;
-ok($new->in_database, 'insert_or_update insert ok');
+ok($new->in_storage, 'insert_or_update insert ok');
 
 # test in update mode
 $new->position(5);
 $new->insert_or_update;
-is( DBICTest::Track->retrieve(100)->position, 5, 'insert_or_update update ok');
+is( DBICTest::Track->find(100)->position, 5, 'insert_or_update update ok');
+
+eval { DBICTest::Track->load_components('DoesNotExist'); };
+
+ok $@, $@;