summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-07-20 19:39:51 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-07-20 19:39:51 +0000
commit043d649f677035805e2600a770074b60412a246a (patch)
treef26ee59a714546a83fd12fedc1ce9e37b0cd9871 /t
parentae6a824cb69c59244204d5472287a6eb8de8cd85 (diff)
downloadperl-MDV-Distribconf-043d649f677035805e2600a770074b60412a246a.tar
perl-MDV-Distribconf-043d649f677035805e2600a770074b60412a246a.tar.gz
perl-MDV-Distribconf-043d649f677035805e2600a770074b60412a246a.tar.bz2
perl-MDV-Distribconf-043d649f677035805e2600a770074b60412a246a.tar.xz
perl-MDV-Distribconf-043d649f677035805e2600a770074b60412a246a.zip
- fix test for new behaviour
Diffstat (limited to 't')
-rw-r--r--t/01distribconf.t21
1 files changed, 15 insertions, 6 deletions
diff --git a/t/01distribconf.t b/t/01distribconf.t
index 685718b..5cceaec 100644
--- a/t/01distribconf.t
+++ b/t/01distribconf.t
@@ -3,7 +3,7 @@
# $Id$
use strict;
-use Test::More tests => 22;
+use Test::More tests => 28;
use_ok('MDV::Distribconf');
@@ -13,7 +13,7 @@ ok(!$dconf->load(), "loading wrong distrib give error");
}
{
-ok(my $dconf = MDV::Distribconf->new('test'), "Can get new MDV::Distribconf");
+ok(my $dconf = MDV::Distribconf->new('test', 1), "Can get new MDV::Distribconf");
ok($dconf->load(), "Can load conf");
ok(scalar($dconf->listmedia) == 8, "Can list all media");
@@ -30,19 +30,28 @@ ok($dconf->getfullpath(undef, 'media_info') =~ m!^/*test/+media/media_info/?$!,
ok($dconf->getpath('main', 'path') =~ m!^/*media/+main/?$!, "Can get media path"); # vim color: */
ok($dconf->getfullpath('main', 'path') =~ m!^/*test/*media/+main/?$!, "Can get media fullpath"); # vim color: */
}
-
{
-ok(my $dconf = MDV::Distribconf->new('not_exists'), "Can get new MDV::Distribconf");
+ok(my $dconf = MDV::Distribconf->new('test2'), "Can get new MDV::Distribconf");
+$dconf->loadtree();
+print STDERR $dconf->getfullpath(undef, 'media_info');
+ok($dconf->getpath(undef, 'root') eq 'test2', "Can get root path");
+ok($dconf->getpath(undef, 'media_info') =~ m!^/*media/media_info/?$!, "Can get media_info path"); # vim color: */
+ok($dconf->getfullpath(undef, 'media_info') =~ m!^/*test2/+media/media_info/?$!, "Can get media_info fullpath"); # vim color: */
+ok($dconf->getpath('main', 'path') =~ m!^/*media/+main/?$!, "Can get media path"); # vim color: */
+ok($dconf->getfullpath('main', 'path') =~ m!^/*test2/*media/+main/?$!, "Can get media fullpath"); # vim color: */
+}
+{
+ok(my $dconf = MDV::Distribconf->new('not_exists', 1), "Can get new MDV::Distribconf");
$dconf->settree();
ok($dconf->getpath(undef, 'media_info') =~ m!^/*media/media_info/?$!, "Can get media_info path"); # vim color: */
}
{
-ok(my $dconf = MDV::Distribconf->new('not_exists'), "Can get new MDV::Distribconf");
+ok(my $dconf = MDV::Distribconf->new('not_exists', 1), "Can get new MDV::Distribconf");
$dconf->settree('manDraKE');
ok($dconf->getpath(undef, 'media_info') =~ m!^/*Mandrake/base/?$!, "Can get media_info path"); # vim color: */
}
{
-ok(my $dconf = MDV::Distribconf->new('not_exists'), "Can get new MDV::Distribconf");
+ok(my $dconf = MDV::Distribconf->new('not_exists', 1), "Can get new MDV::Distribconf");
$dconf->settree({
mediadir => 'mediadir',
infodir => 'infodir',