Skip to content

Commit

Permalink
test for building a LDIFStore
Browse files Browse the repository at this point in the history
  • Loading branch information
russoz committed Nov 6, 2010
1 parent 8bd47ff commit b06bb66
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions t/02.store.t
@@ -1,36 +1,28 @@
use Test::More tests => 1; use Test::More tests => 2;


use Net::LDAP::SimpleServer::LDIFStore; use Net::LDAP::SimpleServer::LDIFStore;


sub _check_param { sub _check_param {
my @p = @_; my @p = @_;
eval { my $o = Net::LDAP::SimpleServer::LDIFStore->new(@p); }; eval { my $o = Net::LDAP::SimpleServer::LDIFStore->new(@p); };
return $@;
} }


sub check_param_success { sub check_param_success {
my $p = _check_param(@_); my $p = _check_param(@_);
ok($p); ok( not $p );
} }


sub check_param_failure { sub check_param_failure {
my $p = _check_param(@_); my $p = _check_param(@_);
ok( not $p ); ok($p);
} }


diag("Testing parameters for the constructor\n"); diag("Testing the constructor params for LDIFStore\n");


check_param_failure('name/of/a/file/that/will/never/ever/exist.ldif'); my $obj = undef;


#if ( -r $cfgfile ) { #$obj = new_ok( 'Net::LDAP::SimpleServer::LDIFStore', [ 'name/of/a/file/that/will/never/ever/exist.ldif' ] );
# diag( "Using default cfg file: " . $cfgfile ); check_param_failure('name/of/a/file/that/will/never/ever/exist.ldif');
# check_param_success(); $obj = new_ok( 'Net::LDAP::SimpleServer::LDIFStore', ['examples/test1.ldif'] );
#}
#else {
# diag("Default cfg file not found");
# check_param_failure();
#}

#SKIP: {
# skip "Not messing with your default configuration file", 1
# if -r $cfgfile;


0 comments on commit b06bb66

Please sign in to comment.