summaryrefslogtreecommitdiffstats
path: root/t/helper.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-12-08 09:33:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-12-08 09:33:32 +0000
commit4e0c51972157e8bca3c7445e6720b51ee3600e5b (patch)
tree0edde9d58c3cd605a47af3673249318ff26f9e47 /t/helper.pm
parente43f97ddb490ddf48d29b3e7b85caa26f2e7b768 (diff)
downloadurpmi-4e0c51972157e8bca3c7445e6720b51ee3600e5b.tar
urpmi-4e0c51972157e8bca3c7445e6720b51ee3600e5b.tar.gz
urpmi-4e0c51972157e8bca3c7445e6720b51ee3600e5b.tar.bz2
urpmi-4e0c51972157e8bca3c7445e6720b51ee3600e5b.tar.xz
urpmi-4e0c51972157e8bca3c7445e6720b51ee3600e5b.zip
add set_urpmi_cfg_global_options()
Diffstat (limited to 't/helper.pm')
-rw-r--r--t/helper.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/helper.pm b/t/helper.pm
index e76d1396..032d8c9a 100644
--- a/t/helper.pm
+++ b/t/helper.pm
@@ -6,6 +6,7 @@ our @EXPORT = qw(need_root_and_prepare
start_httpd httpd_port
urpmi_addmedia urpmi_removemedia
urpmi_cmd urpmi urpme
+ urpmi_cfg set_urpmi_cfg_global_options
system_
);
@@ -61,6 +62,16 @@ sub urpme {
my ($para) = @_;
system_("perl -I.. ../urpme --urpmi-root $::pwd/root $para");
}
+sub urpmi_cfg() {
+ "$::pwd/root/etc/urpmi/urpmi.cfg";
+}
+sub set_urpmi_cfg_global_options {
+ my ($options) = @_;
+ require_ok('urpm::cfg');
+ ok(my $config = urpm::cfg::load_config(urpmi_cfg()));
+ $config->{global} = $options;
+ ok(urpm::cfg::dump_config(urpmi_cfg(), $config), 'set_urpmi_cfg_global_options');
+}
sub system_ {
my ($cmd) = @_;