DBIx-DataModel
view release on metacpan or search on metacpan
t/lib/DBIDM_Test.pm view on Meta::CPAN
}
$dbh->{mock_clear_history} = 1;
}
sub HR_connect {HR->dbh($dbh)};
# die_ok : succeeds if the supplied coderef dies with an exception
sub die_ok(&) {
my $code=shift;
eval {$code->()};
my $err = $@;
$err =~ s/ at .*//;
ok($err, $err);
}
1;
t/v1_DBIx-DataModel.t view on Meta::CPAN
use Data::Dumper;
use SQL::Abstract::Test import => [qw/is_same_sql_bind/];
use Storable qw/dclone/;
use constant N_DBI_MOCK_TESTS => 111;
use constant N_BASIC_TESTS => 15;
use Test::More tests => (N_BASIC_TESTS + N_DBI_MOCK_TESTS);
# die_ok : succeeds if the supplied coderef dies with an exception
sub die_ok(&) {
my $code=shift;
eval {$code->()};
my $err = $@;
$err =~ s/ at .*//;
ok($err, $err);
}
use_ok("DBIx::DataModel", -compatibility=> 1.0);
t/v1_MsAccess.t view on Meta::CPAN
use warnings;
no warnings 'uninitialized';
use DBI;
use SQL::Abstract::Test import => [qw/is_same_sql_bind/];
use constant N_DBI_MOCK_TESTS => 2;
use constant N_BASIC_TESTS => 1;
use Test::More tests => (N_BASIC_TESTS + N_DBI_MOCK_TESTS);
sub die_ok(&) { my $code=shift; eval {$code->()}; ok($@, $@);}
use_ok("DBIx::DataModel", -compatibility=> 1.0);
DBIx::DataModel->Schema('HR', sqlDialect => 'MsAccess');
HR->Table(Employee => T_Employee => qw/emp_id/);
HR->Table(Department => T_Department => qw/dpt_id/);
HR->Table(Activity => T_Activity => qw/act_id/);
HR->Composition([qw/Employee employee 1 /],
[qw/Activity activities * /]);
( run in 1.500 second using v1.01-cache-2.11-cpan-49f99fa48dc )