DBIx-DataModel

 view release on metacpan or  search on metacpan

t/lib/DBIDM_Test.pm  view on Meta::CPAN

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  }
  $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

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 0.261 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )