test_gpg: add initial tests

This commit is contained in:
Dominyk Tiller 2016-08-10 04:58:41 +01:00
parent 92a6a557f5
commit 2c81083f3c
No known key found for this signature in database
GPG Key ID: FE19AEFCF658C6F6

View File

@ -0,0 +1,22 @@
require "testing_env"
require "gpg"
class GpgTest < Homebrew::TestCase
def setup
skip "GPG Unavailable" unless Gpg.available?
@dir = Pathname.new(mktmpdir)
end
def teardown
@dir.rmtree
end
def test_create_test_key
Dir.chdir(@dir) do
with_environment("HOME" => @dir) do
shutup { Gpg.create_test_key(@dir) }
assert_predicate @dir/".gnupg/secring.gpg", :exist?
end
end
end
end