skip tests unless DBD::SQLite installed
[blog.pm-common-perl-mods.git] / Rose-DBx-Object-I18N / t / prefetch.t
blob76e390409091f657e05b5177c002ef5eff611221
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' => 2;
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 => 'barfoo',
25 orig_lang => 'en',
26 signature => 'hello'
28 $u->save();
29 my $id = $u->id;
31 $u = User->new( id => $id );
32 $u->load(
33 query => [ 't2.lang' => 'ru' ],
34 with => [ 'user_i18n' ]
37 is( $u->name, 'barfoo' );
39 is( $u->i18n->lang, 'ru' );
41 $u->delete( cascade => 1 );