diff options
Diffstat (limited to 't')
| -rwxr-xr-x | t/01-test.t | 8 | ||||
| -rwxr-xr-x | t/13-local-check.t | 38 | 
2 files changed, 33 insertions, 13 deletions
| diff --git a/t/01-test.t b/t/01-test.t index f1f9117..153e438 100755 --- a/t/01-test.t +++ b/t/01-test.t @@ -399,10 +399,10 @@ sub {  	my $listing;  	stdout_is(sub { $listing = get_update_list(); }, "Checking for updated SlackBuilds...\n", 'output of get_update_list() good');  	s/\s//g for @$listing; -	is (shift(@$listing), 'adobe-reader9.5.1_enu<needsupdating(SBohas9.5.1)', 'get_update_list listing good for adobe-reader'); -	is (shift(@$listing), 'ffmpeg0.8.7<needsupdating(SBohas0.11.1)', 'get_update_list listing good for ffmpeg'); -	is (shift(@$listing), 'libdvdnav4.1.3<needsupdating(SBohas4.2.0)', 'get_update_list listing test, libdvdnav'); -	is (shift(@$listing), 'mutagen1.15<needsupdating(SBohas1.20)', 'get_update_list listing good for mutagen'); +	is (shift(@$listing), 'adobe-reader9.5.1_enu<needsupdating(9.5.1fromSBo)', 'get_update_list listing good for adobe-reader'); +	is (shift(@$listing), 'ffmpeg0.8.7<needsupdating(0.11.1fromSBo)', 'get_update_list listing good for ffmpeg'); +	is (shift(@$listing), 'libdvdnav4.1.3<needsupdating(4.2.0fromSBo)', 'get_update_list listing test, libdvdnav'); +	is (shift(@$listing), 'mutagen1.15<needsupdating(1.20fromSBo)', 'get_update_list listing good for mutagen');  };  # 47: remove_stuff test - can only really test for invalid input diff --git a/t/13-local-check.t b/t/13-local-check.t index 130ee2e..38d94a4 100755 --- a/t/13-local-check.t +++ b/t/13-local-check.t @@ -10,20 +10,21 @@ use lib $RealBin;  use lib "$RealBin/../SBO-Lib/lib";  use Test::Execute; -if ($ENV{TEST_INSTALL}) { -	plan tests => 0; +if ($ENV{TEST_INSTALL} and $ENV{TRAVIS}) { +	plan tests => 2;  } else { -	plan skip_all => 'Only run these tests if TEST_INSTALL=1'; +	plan skip_all => "Only run these tests if TEST_INSTALL=1 and we're running under Travis CI";  }  $path = "$RealBin/../";  sub cleanup {  	capture_merged { -		system(qw!/sbin/removepkg ...!); -		unlink "$RealBin/LO-.../.../perf.dummy"; -		system(qw!rm -rf /tmp/SBo/...-1.0!); -		system(qw!rm -rf /tmp/package-...!); +		system(qw!/sbin/removepkg nonexistentslackbuild!); +		unlink "$RealBin/LO/nonexistentslackbuild/perf.dummy"; +		system(qw!rm -rf /tmp/SBo/nonexistentslackbuild-1.0!); +		system(qw!rm -rf /tmp/package-nonexistentslackbuild!); +		system(qw!rm -rf!, "$RealBin/gitrepo");  	};  } @@ -47,10 +48,21 @@ sub set_lo {  		$lo //= 'FALSE';  		note "Saving original value of LOCAL_OVERRIDES: $lo";  		$set = 1; -		script (qw/ sboconfig -o /, "$RealBin/LO-...", { test => 0 }); +		script (qw/ sboconfig -o /, "$RealBin/LO", { test => 0 });  	}  } +sub setup_gitrepo { +	capture_merged { system(<<"END"); }; +		cd "$RealBin"; rm -rf gitrepo; mkdir gitrepo; cd gitrepo; +		git init; + +		mkdir -p "test/nonexistentslackbuild"; +		cp "$RealBin/LO2/nonexistentslackbuild/nonexistentslackbuild.info" "test/nonexistentslackbuild" +		git add "test"; git commit -m 'initial'; +END +} +  sub set_repo {  	state $set = 0;  	state $orig; @@ -73,9 +85,17 @@ sub set_repo {  cleanup();  make_slackbuilds_txt();  set_lo(); +setup_gitrepo();  set_repo(); -# 1: ... +script (qw/ sbosnap fetch /, { test => 0 }); + +# 1: sbocheck without having installed nonexistentslackbuild should not show it +script (qw/ sbocheck /, { expected => sub { $_[0] !~ /nonexistentslackbuild/ } }); + +# 2: sbocheck should list nonexistentslackbuild as being newer on SBo after we've installed it +script (qw/ sboinstall nonexistentslackbuild /, { input => "y\ny", test => 0 }); +script (qw/ sbocheck /, { expected => qr/nonexistentslackbuild/ });  # Cleanup  END { | 
