---
name: DBIx-Class-Schema-Loader
-version: 0.02005
+version: 0.02006
author:
- 'Brandon Black, C<blblack@gmail.com>'
abstract: Dynamic definition of a DBIx::Class::Schema
provides:
DBIx::Class::Schema::Loader:
file: lib/DBIx/Class/Schema/Loader.pm
- version: 0.02005
+ version: 0.02006
DBIx::Class::Schema::Loader::DB2:
file: lib/DBIx/Class/Schema/Loader/DB2.pm
DBIx::Class::Schema::Loader::Generic:
# Always remember to do all digits for the version even if they're 0
# i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
# brain damage and presumably various other packaging systems too
-our $VERSION = '0.02005';
+our $VERSION = '0.02006';
__PACKAGE__->mk_classaccessor('loader');
sub run_tests {
my $self = shift;
- plan tests => 50;
+ plan tests => 54;
$self->create();
is( $obj->id, 1 );
is( $obj->dat, "foo" );
is( $rsobj2->count, 4 );
+ my $saved_id;
+ eval {
+ my $new_obj1 = $rsobj1->create({ dat => 'newthing' });
+ $saved_id = $new_obj1->id;
+ };
+ ok(!$@) or diag "Died during create new record using a PK::Auto key: $@";
+ ok($saved_id) or diag "Failed to get PK::Auto-generated id";
+
+ my $new_obj1 = $rsobj1->search({ dat => 'newthing' })->first;
+ ok($new_obj1) or diag "Cannot find newly inserted PK::Auto record";
+ is($new_obj1->id, $saved_id);
my ($obj2) = $rsobj2->find( dat => 'bbb' );
is( $obj2->id, 2 );