summaryrefslogtreecommitdiff
path: root/t/update_version.t
blob: 9daee1987acf21334bc12655e0e906921c0af280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl -w
#
# Request Tracker 4 tests use call() to change the program
# to use to gpg1, however GnuPG::Interface has already set
# the version to 2.2.x and didn't clear the version, therefore
# GnuPG::Interface tried to use --pinentry-mode which
# would fail.
#
# Test to ensure that version is cleared - which is then
# lazy loaded when needed.

use strict;

use lib './t';
use MyTest;

# Make sure that there are some dummy scripts available so no warnings
# are thrown.
$ENV{PATH} .= ":t/bin";

use GnuPG::Interface;

my $gnupg = GnuPG::Interface->new();

# See that version is set
TEST
{
    $gnupg->cmp_version($gnupg->version, '2.2') > 0;
};

$gnupg->call('gpg1');

# See that version is set to 1.4.x.
TEST
{
    $gnupg->cmp_version($gnupg->version, '1.5') < 0;
};