From: Brandon Black Date: Sat, 4 Mar 2006 13:57:46 +0000 (+0000) Subject: version bump, and added a few new tests to make sure PK::Auto::* is working right X-Git-Tag: 0.03000~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b71790b11a7238b8d46dc9b7069a4606bbe7bc05;p=dbsrgits%2FDBIx-Class-Schema-Loader.git version bump, and added a few new tests to make sure PK::Auto::* is working right --- diff --git a/META.yml b/META.yml index b530fa3..9a904e6 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: DBIx-Class-Schema-Loader -version: 0.02005 +version: 0.02006 author: - 'Brandon Black, C' abstract: Dynamic definition of a DBIx::Class::Schema @@ -20,7 +20,7 @@ build_requires: 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: diff --git a/lib/DBIx/Class/Schema/Loader.pm b/lib/DBIx/Class/Schema/Loader.pm index bfb867a..20b014a 100644 --- a/lib/DBIx/Class/Schema/Loader.pm +++ b/lib/DBIx/Class/Schema/Loader.pm @@ -10,7 +10,7 @@ use UNIVERSAL::require; # 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'); diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 9e3fb5c..d1a66fd 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -43,7 +43,7 @@ sub _monikerize { sub run_tests { my $self = shift; - plan tests => 50; + plan tests => 54; $self->create(); @@ -158,6 +158,17 @@ sub run_tests { 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 );