Skip to content
Snippets Groups Projects
Commit 4d6e3199 authored by Markus Reiter's avatar Markus Reiter Committed by GitHub
Browse files

Merge pull request #2434 from JCount/gpg-spec-test-21-compatibility

gpg_spec test add 2.1.x compatibility
parents d84655ef 43b64bfe
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ class Gpg
gpg_short_version = Utils.popen_read(gpg, "--version")[/\d\.\d/, 0]
next unless gpg_short_version
gpg_version = Version.create(gpg_short_version.to_s)
@version = gpg_version
gpg_version == Version.create("2.0") ||
gpg_version == Version.create("2.1")
end
......@@ -25,6 +26,10 @@ class Gpg
File.executable?(GPG_EXECUTABLE.to_s)
end
def self.version
@version if available?
end
def self.create_test_key(path)
odie "No GPG present to test against!" unless available?
......
......@@ -9,7 +9,7 @@ describe GPG2Requirement do
ENV["PATH"] = dir/"bin"
(dir/"bin/gpg").write <<-EOS.undent
#!/bin/bash
echo 2.0.30
echo 2.1.20
EOS
FileUtils.chmod 0755, dir/"bin/gpg"
......
......@@ -13,7 +13,12 @@ describe Gpg do
shutup do
subject.create_test_key(dir)
end
expect(dir/".gnupg/secring.gpg").to exist
if subject.version == Version.create("2.0")
expect(dir/".gnupg/secring.gpg").to be_a_file
else
expect(dir/".gnupg/pubring.kbx").to be_a_file
end
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment