Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xavier Bachelot
lemonldap-ng
Commits
09f1a45c
Commit
09f1a45c
authored
Dec 26, 2008
by
Yadd
Browse files
LEONLDAP::NG : Better tests for Lemonldap::NG::Common
parent
ad0ed7f3
Changes
6
Hide whitespace changes
Inline
Side-by-side
modules/lemonldap-ng-common/MANIFEST
View file @
09f1a45c
...
...
@@ -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
...
...
modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm
View file @
09f1a45c
...
...
@@ -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
;
...
...
modules/lemonldap-ng-common/t/01-
Manager
-Conf.t
→
modules/lemonldap-ng-common/t/01-
Common
-Conf.t
View file @
09f1a45c
...
...
@@ -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
'
);
modules/lemonldap-ng-common/t/02-
Manager
-Conf-File.t
→
modules/lemonldap-ng-common/t/02-
Common
-Conf-File.t
View file @
09f1a45c
...
...
@@ -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
',
);
modules/lemonldap-ng-common/t/03-
Manager
-Conf-DBI.t
→
modules/lemonldap-ng-common/t/03-
Common
-Conf-DBI.t
View file @
09f1a45c
...
...
@@ -26,3 +26,4 @@ ok(
);
ok
(
$h
->
can
(
'
dbh
'
)
);
modules/lemonldap-ng-common/t/04-
Manager
-Conf-SOAP.t
→
modules/lemonldap-ng-common/t/04-
Common
-Conf-SOAP.t
View file @
09f1a45c
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment