LEONLDAP::NG : Better tests for Lemonldap::NG::Common

environments/ppa-mbqj77/deployments/1
Xavier Guimard 17 years ago
parent ad0ed7f3ba
commit 09f1a45cab
  1. 8
      modules/lemonldap-ng-common/MANIFEST
  2. 4
      modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm
  3. 17
      modules/lemonldap-ng-common/t/01-Common-Conf.t
  4. 6
      modules/lemonldap-ng-common/t/02-Common-Conf-File.t
  5. 1
      modules/lemonldap-ng-common/t/03-Common-Conf-DBI.t
  6. 0
      modules/lemonldap-ng-common/t/04-Common-Conf-SOAP.t

@ -14,10 +14,10 @@ META.yml Module meta-data (added by MakeMaker)
README
scripts/lmConfig_File2MySQL
storage.conf
t/01-Manager-Conf.t
t/02-Manager-Conf-File.t
t/03-Manager-Conf-DBI.t
t/04-Manager-Conf-SOAP.t
t/01-Common-Conf.t
t/02-Common-Conf-File.t
t/03-Common-Conf-DBI.t
t/04-Common-Conf-SOAP.t
t/10-Common.t
t/99-pod.t
tools/apache-session-mysql.sql

@ -15,8 +15,6 @@ our %_confFiles;
sub new {
my $class = shift;
my $args;
$args ||= {};
my $self = bless {}, $class;
if ( ref( $_[0] ) ) {
%$self = %{ $_[0] };
@ -25,7 +23,7 @@ sub new {
%$self = @_;
}
unless ( $self->{mdone} ) {
$self->_readConfFile( $self->{confFile} );
$self->_readConfFile( $self->{confFile} ) unless ( $self->{type} );
unless ( $self->{type} ) {
$msg .= "Error: configStorage: type is not defined\n";
return 0;

@ -5,7 +5,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
use Test::More tests => 3;
BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
#########################
@ -13,3 +13,18 @@ BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
my $h;
ok(
(
Lemonldap::NG::Common::Conf->new( type => 'bad' ) == 0
and $Lemonldap::NG::Common::Conf::msg =~
/Error: Unknown package Lemonldap::NG::Common::Conf::bad$/
),
'Bad module'
);
$h = bless {}, 'Lemonldap::NG::Common::Conf';
ok( $h->_readConfFile('storage.conf'), 'Read storage.conf' );

@ -14,12 +14,14 @@ BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
# its man page ( perldoc Test::More ) for help writing this test script.
my $h;
@ARGV = ("help=groups");
ok(
$h = new Lemonldap::NG::Common::Conf(
{
type => 'File',
dirName => ".",
}
)
),
'type => file',
);
Loading…
Cancel
Save