Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test for building a LDIFStore

  • Loading branch information...
commit b06bb6656dbda9045ae6df715424add1aa7001bf 1 parent 8bd47ff
@russoz russoz authored
Showing with 9 additions and 17 deletions.
  1. +9 −17 t/02.store.t
View
26 t/02.store.t
@@ -1,36 +1,28 @@
-use Test::More tests => 1;
+use Test::More tests => 2;
use Net::LDAP::SimpleServer::LDIFStore;
sub _check_param {
my @p = @_;
eval { my $o = Net::LDAP::SimpleServer::LDIFStore->new(@p); };
+ return $@;
}
sub check_param_success {
my $p = _check_param(@_);
- ok($p);
+ ok( not $p );
}
sub check_param_failure {
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 ) {
-# diag( "Using default cfg file: " . $cfgfile );
-# check_param_success();
-#}
-#else {
-# diag("Default cfg file not found");
-# check_param_failure();
-#}
-
-#SKIP: {
-# skip "Not messing with your default configuration file", 1
-# if -r $cfgfile;
+#$obj = new_ok( 'Net::LDAP::SimpleServer::LDIFStore', [ 'name/of/a/file/that/will/never/ever/exist.ldif' ] );
+check_param_failure('name/of/a/file/that/will/never/ever/exist.ldif');
+$obj = new_ok( 'Net::LDAP::SimpleServer::LDIFStore', ['examples/test1.ldif'] );
Please sign in to comment.
Something went wrong with that request. Please try again.