aboutsummaryrefslogtreecommitdiff
path: root/t/02.2-unit-repo.t
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-08-31 00:26:15 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-08-31 00:26:15 +0200
commit1487aaecb1db46315bd267854f71de985caafda7 (patch)
treeaab6662c04257b353031135fec59c7f57ffb4a60 /t/02.2-unit-repo.t
parente58c649c2a37dd24399a01b5469ad17b30853081 (diff)
downloadsbotools2-1487aaecb1db46315bd267854f71de985caafda7.tar.xz
02.2-unit-repo.t: add test for get_sbo_downloads for 32bit
Diffstat (limited to 't/02.2-unit-repo.t')
-rwxr-xr-xt/02.2-unit-repo.t15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/02.2-unit-repo.t b/t/02.2-unit-repo.t
index 5f28f32..e06fc82 100755
--- a/t/02.2-unit-repo.t
+++ b/t/02.2-unit-repo.t
@@ -6,12 +6,12 @@ use Test::More;
use Test::Exit;
use FindBin '$RealBin';
use lib "$RealBin/../SBO-Lib/lib";
-use SBO::Lib qw/ do_slackbuild rsync_sbo_tree /;
+use SBO::Lib qw/ do_slackbuild rsync_sbo_tree get_sbo_downloads /;
use Capture::Tiny qw/ capture_merged /;
use File::Path qw/ remove_tree /;
if (defined $ENV{TRAVIS} and $ENV{TRAVIS} eq 'true') {
- plan tests => 12;
+ plan tests => 13;
} else {
plan skip_all => 'Only run these tests under Travis CI (TRAVIS=true)';
}
@@ -99,5 +99,16 @@ SKIP: {
is_deeply (\@ret, ["sentinel", undef, undef, -1], "do_slackbuild() returned the correct things when it's on 32bit.");
}
+# 13: test get_sbo_downloads() which thinks it's on 32bit
+{
+ no warnings 'redefine';
+ local *SBO::Lib::Download::get_arch = sub { return 'i586' };
+
+ my $ret = get_sbo_downloads(LOCATION => "/usr/sbo/repo/test/test2");
+
+ ok (exists $ret->{'http://pink-mist.github.io/sbotools/testing/32/perf.dummy'}, "get_sbo_downloads() returned the correct link for 32bit.")
+ or diag explain $ret;
+}
+
remove_tree($repo);
rename "$repo.orig", $repo if $moved;