skip tests unless DBD::SQLite installed
[blog.pm-common-perl-mods.git] / Rose-DBx-Object-I18N / t / available-translations-after-prefetch.t
blob3d590d7977c410fdaa318affbf89656badecb4ad
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;
18 my $db = NewDB->new();
20 $db->init();
22 my $u = User->new(
23 name => 'ppp',
24 orig_lang => 'ru',
25 signature => 'hello'
27 $u->save();
29 $u->load( i18n => 'en' );
30 is_deeply( $u->i18n_available_translations, [] );
32 $u->i18n->signature( 'hello2' );
33 $u->save();
34 is_deeply( $u->i18n_available_translations, [ 'ru' ] );
36 $u->delete( cascade => 1 );