[Bast-commits] r8117 -
DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin
goraxe at dev.catalyst.perl.org
goraxe at dev.catalyst.perl.org
Tue Dec 15 22:16:00 GMT 2009
Author: goraxe
Date: 2009-12-15 22:16:00 +0000 (Tue, 15 Dec 2009)
New Revision: 8117
Modified:
DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/01load.t
DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/02ddl.t
DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/03data.t
Log:
update test suite to skip if cannot load DBIx::Class::Admin
Modified: DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/01load.t
===================================================================
--- DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/01load.t 2009-12-15 22:15:25 UTC (rev 8116)
+++ DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/01load.t 2009-12-15 22:16:00 UTC (rev 8117)
@@ -8,8 +8,7 @@
# FILES: ---
# BUGS: ---
# NOTES: ---
-# AUTHOR: Gordon Irving (), <Gordon.irving at sophos.com>
-# COMPANY: Sophos
+# AUTHOR: Gordon Irving (), <goraxe at cpan.org>
# VERSION: 1.0
# CREATED: 28/11/09 13:54:30 GMT
# REVISION: ---
@@ -20,12 +19,21 @@
use Test::More; # last test to print
+use FindBin qw($Bin);
use Path::Class;
-use FindBin qw($Bin);
+
+
use lib dir($Bin,'..', '..','lib')->stringify;
use lib dir($Bin,'..', 'lib')->stringify;
-use ok 'DBIx::Class::Admin';
+BEGIN {
+ eval "use DBIx::Class::Admin";
+ plan skip_all => "Deps not installed: $@" if $@;
+}
+
+use_ok 'DBIx::Class::Admin';
+
+
done_testing;
Modified: DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/02ddl.t
===================================================================
--- DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/02ddl.t 2009-12-15 22:15:25 UTC (rev 8116)
+++ DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/02ddl.t 2009-12-15 22:16:00 UTC (rev 8117)
@@ -8,8 +8,7 @@
# FILES: ---
# BUGS: ---
# NOTES: ---
-# AUTHOR: Gordon Irving (), <Gordon.irving at sophos.com>
-# COMPANY: Sophos
+# AUTHOR: Gordon Irving (), <goraxe at cpan.org>
# VERSION: 1.0
# CREATED: 28/11/09 16:14:21 GMT
# REVISION: ---
@@ -22,9 +21,14 @@
use Test::Exception;
+
+BEGIN {
+ eval "use DBIx::Class::Admin";
+ plan skip_all => "Deps not installed: $@" if $@;
+}
+
use Path::Class;
use FindBin qw($Bin);
-
use Module::Load;
use lib dir($Bin,'..', '..','lib')->stringify;
Modified: DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/03data.t
===================================================================
--- DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/03data.t 2009-12-15 22:15:25 UTC (rev 8116)
+++ DBIx-Class/0.08/branches/dbicadmin_refactor/t/admin/03data.t 2009-12-15 22:16:00 UTC (rev 8117)
@@ -8,7 +8,7 @@
# FILES: ---
# BUGS: ---
# NOTES: ---
-# AUTHOR: Gordon Irving (), <Gordon.irving at sophos.com>
+# AUTHOR: Gordon Irving (), <goraxe at cpan.org>
# VERSION: 1.0
# CREATED: 12/12/09 12:44:57 GMT
# REVISION: ---
@@ -22,6 +22,11 @@
use Test::Exception;
use Test::Deep;
+BEGIN {
+ eval "use DBIx::Class::Admin";
+ plan skip_all => "Deps not installed: $@" if $@;
+}
+
use Path::Class;
use FindBin qw($Bin);
@@ -50,19 +55,19 @@
);
isa_ok ($admin, 'DBIx::Class::Admin', 'create the admin object');
- $admin->insert_data('Employee', { name => 'Matt' });
+ $admin->insert('Employee', { name => 'Matt' });
my $employees = $schema->resultset('Employee');
is ($employees->count(), 1, "insert okay" );
my $employee = $employees->find(1);
is($employee->name(), 'Matt', "insert valid" );
- $admin->update_data('Employee', {name => 'Trout'}, {name => 'Matt'});
+ $admin->update('Employee', {name => 'Trout'}, {name => 'Matt'});
$employee = $employees->find(1);
is($employee->name(), 'Trout', "update Matt to Trout" );
- $admin->insert_data('Employee', {name =>'Aran'});
+ $admin->insert('Employee', {name =>'Aran'});
my $expected_data = [
[$employee->result_source->columns() ],
@@ -70,10 +75,10 @@
[2,2,undef,undef,undef,'Aran']
];
my $data;
- lives_ok { $data = $admin->select_data('Employee')} 'can retrive data from database';
+ lives_ok { $data = $admin->select('Employee')} 'can retrive data from database';
cmp_deeply($data, $expected_data, 'DB matches whats expected');
- $admin->delete_data('Employee', {name=>'Trout'});
+ $admin->delete('Employee', {name=>'Trout'});
my $del_rs = $employees->search({name => 'Trout'});
is($del_rs->count(), 0, "delete Trout" );
is ($employees->count(), 1, "left Aran" );
More information about the Bast-commits
mailing list