summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ruthven <andrew@etc.gen.nz>2023-12-15 22:14:01 +0100
committergregor herrmann <gregoa@debian.org>2023-12-15 22:14:01 +0100
commit8c8ae2615ba9d2b19f081ab48d1ca6aa906e0461 (patch)
tree9a82279fb78867de3d731b3817c0086bbaf62619
parent8db1b602822ef94f1b33783af67d5dbf63ce1bab (diff)
Using 'call' method doesn't reset gpg version
Bug: https://rt.cpan.org/Ticket/Display.html?id=133021 Last-Update: 2021-01-28 GnuPG::Interface allows the use of the 'call' method to change the program to be used. Test that this works. Gbp-Pq: Name test_reset_version_on_call_change
-rw-r--r--t/update_version.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/update_version.t b/t/update_version.t
new file mode 100644
index 0000000..1a27e9b
--- /dev/null
+++ b/t/update_version.t
@@ -0,0 +1,33 @@
+#!/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;
+
+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;
+};