summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2005-10-09 22:12:33 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2005-10-09 22:12:33 +0000
commit4215ddb5457f9e632bdb5e7b787251fb093a9cf2 (patch)
tree8a8936dd98746b1505355785284a54f661a5edf7 /t
parent0609bac26404c93238819a01530b32d8834079b1 (diff)
downloadperl-MDV-Distribconf-4215ddb5457f9e632bdb5e7b787251fb093a9cf2.tar
perl-MDV-Distribconf-4215ddb5457f9e632bdb5e7b787251fb093a9cf2.tar.gz
perl-MDV-Distribconf-4215ddb5457f9e632bdb5e7b787251fb093a9cf2.tar.bz2
perl-MDV-Distribconf-4215ddb5457f9e632bdb5e7b787251fb093a9cf2.tar.xz
perl-MDV-Distribconf-4215ddb5457f9e632bdb5e7b787251fb093a9cf2.zip
- more tests
Diffstat (limited to 't')
-rw-r--r--t/01distribconf.t24
1 files changed, 23 insertions, 1 deletions
diff --git a/t/01distribconf.t b/t/01distribconf.t
index b058419..8899d40 100644
--- a/t/01distribconf.t
+++ b/t/01distribconf.t
@@ -3,7 +3,29 @@
# $Id$
use strict;
-use Test::More tests => 1;
+use Test::More tests => 16;
use_ok('MDV::Distribconf');
+{
+ok(my $dconf = MDV::Distribconf->new('/dev/null'), "Can get new MDV::Distribconf");
+ok(!$dconf->load(), "loading wrong distrib give error");
+}
+
+ok(my $dconf = MDV::Distribconf->new('test'), "Can get new MDV::Distribconf");
+ok($dconf->load(), "Can load conf");
+
+ok(scalar($dconf->listmedia) == 8, "Can list all media");
+ok(grep { $_ eq 'main' } $dconf->listmedia, "list properly media");
+
+ok($dconf->getvalue(undef, 'version') eq '2006.0', "Can get global value");
+ok($dconf->getvalue('main', 'version') eq '2006.0', "Can get global value via media");
+ok($dconf->getvalue('main', 'name') eq 'main', "Can get default name");
+ok($dconf->getvalue('contrib', 'name') eq 'Contrib', "Can get media name");
+
+ok($dconf->getpath(undef, 'root') eq 'test', "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!^/*test/+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!^/*test/*media/+main/?$!, "Can get media fullpath"); # vim color: */
+