# FILES: ---
# BUGS: ---
# NOTES: ---
-# AUTHOR: Gordon Irving (), <Gordon.irving@sophos.com>
-# COMPANY: Sophos
+# AUTHOR: Gordon Irving (), <goraxe@cpan.org>
# VERSION: 1.0
# CREATED: 28/11/09 13:54:30 GMT
# REVISION: ---
use Test::More; # last test to print
-use Path::Class;
use FindBin qw($Bin);
+use Path::Class;
+
+
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;
# FILES: ---
# BUGS: ---
# NOTES: ---
-# AUTHOR: Gordon Irving (), <Gordon.irving@sophos.com>
-# COMPANY: Sophos
+# AUTHOR: Gordon Irving (), <goraxe@cpan.org>
# VERSION: 1.0
# CREATED: 28/11/09 16:14:21 GMT
# REVISION: ---
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;
# FILES: ---
# BUGS: ---
# NOTES: ---
-# AUTHOR: Gordon Irving (), <Gordon.irving@sophos.com>
+# AUTHOR: Gordon Irving (), <goraxe@cpan.org>
# VERSION: 1.0
# CREATED: 12/12/09 12:44:57 GMT
# REVISION: ---
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);
);
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() ],
[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" );