X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fadmin%2F03data.t;h=872b1cf74cd5dd7d5285b2a634f3fafae5477e02;hb=a85b7ebe9762ca64a08468f6c8f27a0ae583d38c;hp=35c285ead3aa0b062e03e1b22fa401c2d997b421;hpb=1edd4ca695754f9ffdebff19f3ea918ecc72d2fd;p=dbsrgits%2FDBIx-Class.git diff --git a/t/admin/03data.t b/t/admin/03data.t index 35c285e..872b1cf 100644 --- a/t/admin/03data.t +++ b/t/admin/03data.t @@ -1,52 +1,27 @@ -# -#=============================================================================== -# -# FILE: 03sql.t -# -# DESCRIPTION: test sql manipulation funtions -# -# FILES: --- -# BUGS: --- -# NOTES: --- -# AUTHOR: Gordon Irving (), -# VERSION: 1.0 -# CREATED: 12/12/09 12:44:57 GMT -# REVISION: --- -#=============================================================================== - use strict; use warnings; use Test::More; - use Test::Exception; -use Test::Deep; BEGIN { - - use FindBin qw($Bin); - use File::Spec::Functions qw(catdir); - use lib catdir($Bin,'..', '..','lib'); - use lib catdir($Bin,'..', 'lib'); - eval "use DBIx::Class::Admin"; - plan skip_all => "Deps not installed: $@" if $@; + require DBIx::Class; + plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin') + unless DBIx::Class::Optional::Dependencies->req_ok_for('admin'); } -use Path::Class; +use lib 't/lib'; +use DBICTest; -use ok 'DBIx::Class::Admin'; +use_ok 'DBIx::Class::Admin'; -use DBICTest; { # test data maniplulation functions # create a DBICTest so we can steal its connect info my $schema = DBICTest->init_schema( - # no_deploy=>1, - # no_populate=>1, sqlite_use_file => 1, - ); - + ); my $admin = DBIx::Class::Admin->new( schema_class=> "DBICTest::Schema", @@ -72,12 +47,12 @@ use DBICTest; my $expected_data = [ [$employee->result_source->columns() ], - [1,1,undef,undef,undef,'Trout'], - [2,2,undef,undef,undef,'Aran'] + [1,1,undef,undef,undef,'Trout',undef], + [2,2,undef,undef,undef,'Aran',undef] ]; my $data; lives_ok { $data = $admin->select('Employee')} 'can retrive data from database'; - cmp_deeply($data, $expected_data, 'DB matches whats expected'); + is_deeply($data, $expected_data, 'DB matches whats expected'); $admin->delete('Employee', {name=>'Trout'}); my $del_rs = $employees->search({name => 'Trout'}); @@ -85,6 +60,4 @@ use DBICTest; is ($employees->count(), 1, "left Aran" ); } - - done_testing;