App-CELL

 view release on metacpan or  search on metacpan

t/110-site.t  view on Meta::CPAN

#!perl
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log $meta $core $site );
use App::CELL::Test qw( mktmpdir cleartmpdir populate_file );
#use App::CELL::Test::LogToFile;
#use Data::Dumper;
use File::Spec;
use Scalar::Util qw( blessed );
use Test::More;
use Test::Warnings;

my $status;
delete $ENV{CELL_DEBUG_MODE};
$log->init( ident => 'CELLtest', debug_mode => 1 );
$log->info("------------------------------------------------------- ");
$log->info("---                   110-site.t                    ---");
$log->info("------------------------------------------------------- ");

$status = mktmpdir();
ok( $status->ok, "Temporary directory created" );
my $sitedir = $status->payload;
ok( -d $sitedir, "tmpdir is a directory" );
ok( -W $sitedir, "tmpdir is writable by us" );

my $full_path = File::Spec->catfile( $sitedir, 'CELL_Message_en.conf' );
my $stuff = <<'EOS';
# some messages in English
TEST_MESSAGE
This is a test message.

FOO_BAR
Message that says foo bar.

BAR_ARGS_MSG
This %s message takes %s arguments.

EOS
#diag( "Now populating $full_path" );
populate_file( $full_path, $stuff );

$full_path = File::Spec->catfile( $sitedir, 'CELL_Message_cz.conf' );
$stuff = <<'EOS';
# some messages in Czech
TEST_MESSAGE
Tato zpráva slouží k testování.

FOO_BAR
Zpráva, která zní foo bar.

BAR_ARGS_MSG
Tato %s zpráva bere %s argumenty.

EOS
#diag( "Now populating $full_path" );
populate_file( $full_path, $stuff );

$full_path = File::Spec->catfile( $sitedir, 'CELL_SiteConfig.pm' );
$stuff = <<'EOS';
# set supported languages
set( 'CELL_SUPP_LANG', [ 'en', 'cz' ] );

# a random parameter
set( 'A_RANDOM_PARAMETER', "34WDFWWD" );

1;
EOS



( run in 0.631 second using v1.01-cache-2.11-cpan-5a3173703d6 )