skip tests unless DBD::SQLite installed
[blog.pm-common-perl-mods.git] / Rose-DBx-Object-I18N / t / insert.t
bloba3bac9394e6020bc9599211ebc7ed01e77f29db3
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
6 use Test::More;
8 eval "use DBD::SQLite";
9 plan skip_all => "DBD::SQLite is required to run this test" if $@;
11 plan 'tests' => 4;
13 use lib 't/lib';
15 use NewDB;
16 use User;
17 use User::Manager;
19 my $db = NewDB->new();
21 $db->init();
23 my $u = User->new(
24 name => 'foo',
25 orig_lang => 'en'
28 is( $u->name, 'foo' );
29 is( $u->orig_lang, 'en' );
31 $u->user_i18n( { signature => 'hello' } );
32 is( scalar @{ $u->user_i18n }, 1 );
34 $u->save();
36 is( scalar @{ $u->user_i18n }, 3 );
38 $u->delete( cascade => 1 );