Newer Older
30 lines | 0.648kb
added common test executing ...
Yuki Kimoto authored on 2011-08-07
1
use Test::More;
2
use strict;
3
use warnings;
4
use DBIx::Custom;
5

            
6
$SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DEPRECATED/};
7

            
8
my $dbi;
9

            
10
plan skip_all => $ENV{DBIX_CUSTOM_SKIP_MESSAGE} || 'common.t is always skipped'
11
  unless $ENV{DBIX_CUSTOM_TEST_RUN}
12
    && eval { $dbi = DBIx::Custom->connect; 1 };
13

            
14
plan 'no_plan';
15

            
16
# Constant
17
my $create_table1 = $dbi->create_table1;
18

            
19
# Variable
20
my $model;
21

            
22
# Drop table
23
eval { $dbi->execute('drop table table1') };
24

            
25
# Create table
26
$dbi->execute($create_table1);
27
$model = $dbi->create_model(table => 'table1');
28
$model->insert({key1 => 1, key2 => 2});
29
is_deeply($model->select->all, [{key1 => 1, key2 => 2}]);
30