brew/Library/Homebrew/test/gpg_spec.rb
JCount 0e1b7ce8ea gpg_spec: make test compatible with gnupg 2.1.x
maintain existing compatibility with gnupg 2.0.x
2017-04-01 21:29:09 -04:00

26 lines
547 B
Ruby

require "gpg"
describe Gpg do
subject { described_class }
describe "::create_test_key" do
it "creates a test key in the home directory" do
skip "GPG Unavailable" unless subject.available?
mktmpdir do |dir|
ENV["HOME"] = dir
shutup do
subject.create_test_key(dir)
end
begin
expect(dir/".gnupg/pubring.kbx").to be_file
rescue RSpec::Expectations::ExpectationNotMetError
expect(dir/".gnupg/secring.gpg").to be_file
end
end
end
end
end