[Bast-commits] r3386 - in trunk/DBIx-Class-InflateColumn-ISBN: . t
penguin at dev.catalyst.perl.org
penguin at dev.catalyst.perl.org
Sat May 26 11:48:55 GMT 2007
Author: penguin
Date: 2007-05-26 11:48:53 +0100 (Sat, 26 May 2007)
New Revision: 3386
Modified:
trunk/DBIx-Class-InflateColumn-ISBN/Changes
trunk/DBIx-Class-InflateColumn-ISBN/t/01-isbn.t
Log:
Nuked warnings from DBIC::InflateColumB::ISBN
Modified: trunk/DBIx-Class-InflateColumn-ISBN/Changes
===================================================================
--- trunk/DBIx-Class-InflateColumn-ISBN/Changes 2007-05-25 17:10:23 UTC (rev 3385)
+++ trunk/DBIx-Class-InflateColumn-ISBN/Changes 2007-05-26 10:48:53 UTC (rev 3386)
@@ -1,5 +1,7 @@
Revision history for DBIx::Class::InflateColumn::ISBN
+ - Nuked warnings from the tests.
+
0.02000 Fri May 25 15:41:44 2007
- Started using longer version numbers.
- Fixed bug in deflate method for Business::ISBN 1.x.
Modified: trunk/DBIx-Class-InflateColumn-ISBN/t/01-isbn.t
===================================================================
--- trunk/DBIx-Class-InflateColumn-ISBN/t/01-isbn.t 2007-05-25 17:10:23 UTC (rev 3385)
+++ trunk/DBIx-Class-InflateColumn-ISBN/t/01-isbn.t 2007-05-26 10:48:53 UTC (rev 3386)
@@ -1,4 +1,7 @@
#!perl -T
+use strict;
+use warnings;
+
use lib qw(t/lib);
use DBICTest;
use Test::More tests => 19;
@@ -13,14 +16,15 @@
isa_ok($book->isbn, 'Business::ISBN', 'data inflated to right class');
is($book->isbn->isbn, $code, 'data correctly inflated');
-my $book = $rs->find(2);
+$book = $rs->find(2);
isa_ok($book->isbn, 'Business::ISBN', 'data inflated to right class');
isa_ok(\$book->book, 'SCALAR', 'other field not inflated');
is($book->isbn->isbn, '190351133X', 'data with X correctly inflated');
+my $book2;
TODO: {
local $TODO = "DBIx::Class doesn't support find by object yet";
- my $book2 = $rs->find( Business::ISBN->new($code),
+ $book2 = $rs->find( Business::ISBN->new($code),
{ key => 'isbn' } );
ok($book2, 'find by object returned a row');
}
@@ -38,15 +42,15 @@
}
my $isbn = Business::ISBN->new('0374292795');
-my $host = $rs->create({ book => 'foo', isbn => $isbn });
-isa_ok($host, 'DBICTest::Library', 'create with object');
-is($host->get_column('isbn'), $isbn->isbn, 'numeric code correctly deflated');
+$book = $rs->create({ book => 'foo', isbn => $isbn });
+isa_ok($book, 'DBICTest::Library', 'create with object');
+is($book->get_column('isbn'), $isbn->isbn, 'numeric code correctly deflated');
$isbn = Business::ISBN->new('071351700X');
-my $host = $rs->create({ book => 'Elementary Mechanics', isbn => $isbn });
-isa_ok($host, 'DBICTest::Library', 'create with object');
-is($host->get_column('isbn'), $isbn->isbn, 'code with X correctly deflated');
-ok($host->isbn->is_valid, 'validation checked');
+$book = $rs->create({ book => 'Elementary Mechanics', isbn => $isbn });
+isa_ok($book, 'DBICTest::Library', 'create with object');
+is($book->get_column('isbn'), $isbn->isbn, 'code with X correctly deflated');
+ok($book->isbn->is_valid, 'validation checked');
$isbn = Business::ISBN->new('0713517001');
my $host = $rs->create({ book => 'Elementary Mechanics', isbn => $isbn });
@@ -58,7 +62,7 @@
#eval { $book = $rs->create({ book => 'foobar', isbn => $isbn }); };
#ok($@, 'check for error with invalid data');
-my $isbn = Business::ISBN->new('978-0-596-52724-2');
+$isbn = Business::ISBN->new('978-0-596-52724-2');
SKIP: {
skip 'ISBN13 not supported' => 2 unless $isbn;
my $host = $rs->create({ book => 'baz', isbn => $isbn->isbn });
More information about the Bast-commits
mailing list