--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+if (grep { $_ eq 'upgrade' } @ARGV) {
+ printf "%s %s (%s)\n", @$_ for
+ ['Inst', 'foo', 'some foo info'],
+ ['Somethingelse', 'bar', 'some bar info'],
+ ['Remv', 'baz', 'some baz info'];
+}
+elsif (grep { $_ eq 'update' } @ARGV) {
+ print "OK\n";
+}
use strictures 1;
use Test::More;
+use FindBin;
use System::Introspector::Probe::Packages::Apt;
'versions',
);
+do {
+ local $ENV{PATH} = join ':', "$FindBin::Bin/bin", $ENV{PATH};
+ my $probe = System::Introspector::Probe::Packages::Apt->new(
+ apt_update => 1,
+ apt_update_after => 0,
+ );
+ my $data = $probe->gather;
+ is_deeply $data->{upgradable}, {
+ actions => {
+ inst => { foo => '(some foo info)' },
+ remv => { baz => '(some baz info)' },
+ },
+ }, 'upgradable packages';
+ ok $data->{update}{last}, 'has last update time';
+ ok $data->{update}{run}, 'has apt run state';
+};
+
done_testing;