DBIx-Brev

 view release on metacpan or  search on metacpan

t/DBIx-Brev.t  view on Meta::CPAN

    my %config1 = DBIx::Brev::load_config($config_file);
    is_deeply(\%config,\%config1,"load config using explicit filename");
    # load config from HOME
    SKIP: {
        delete $ENV{DBI_CONF};
        my $mswin = $^O eq 'MSWin32';
        my $fd = $mswin?q{\\}:q{/};
        my ($home) = grep defined && -d, map $ENV{$_}, $mswin? qw(USERPROFILE HOME):'HOME';
        skip "was not able to find HOME directory", 1 unless defined($home);
        my $home_config = $home.$fd.q{dbi.conf};
        my $backup = -f $home_config?grep(!-f,map $home_config.substr(rand(),1),1..10):();
        my %config2;
        skip "was not able to create/replace $home_config",1 unless eval {
            move($home_config,$backup) if $backup;
            move($config_file,$home_config);
            %config2 = DBIx::Brev::load_config();
            unlink $home_config;
            move($backup,$home_config) if $backup;
            1;
        };
        is_deeply(\%config2,\%config,q{load config from HOME directory});
    };
    unlink $config_file;
    is($config{database}{dbm}{data_source},"dbi:SQLite:dbname=$db_file",'config file data_source');
}

sub test_fork {
    SKIP: {



( run in 1.020 second using v1.01-cache-2.11-cpan-49f99fa48dc )