skip tests unless DBD::SQLite installed
[blog.pm-common-perl-mods.git] / Rose-DBx-Object-I18N / t / init.t
blob57982cc07ac495453ac5fcfccde62a8e35e1a784
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' => 8;
13 use lib 't/lib';
15 use User;
17 my $u = User->new(
18 name => 'foo',
19 orig_lang => 'en',
20 user_i18n => {
21 signature => 'hello'
25 is( $u->name, 'foo' );
26 is( $u->orig_lang, 'en' );
30 my $translation = shift @{ $u->user_i18n };
31 ok( $translation );
32 is( $translation->isa( 'UserI18N' ), 1 );
34 $u = User->new(
35 name => 'foo',
36 orig_lang => 'en',
37 signature => 'hello'
40 is( $u->name, 'foo' );
41 is( $u->orig_lang, 'en' );
43 $translation = shift @{ $u->user_i18n };
44 ok( $translation );
45 is( $translation->isa( 'UserI18N' ), 1 );