2016-08-10 21:36:07 +01:00
|
|
|
require "testing_env"
|
|
|
|
require "requirements/gpg2_requirement"
|
|
|
|
require "fileutils"
|
|
|
|
|
|
|
|
class GPG2RequirementTests < Homebrew::TestCase
|
|
|
|
def setup
|
2017-01-21 11:21:30 +00:00
|
|
|
super
|
2016-08-10 21:36:07 +01:00
|
|
|
@dir = Pathname.new(mktmpdir)
|
|
|
|
(@dir/"bin/gpg").write <<-EOS.undent
|
|
|
|
#!/bin/bash
|
|
|
|
echo 2.0.30
|
|
|
|
EOS
|
|
|
|
FileUtils.chmod 0755, @dir/"bin/gpg"
|
|
|
|
end
|
|
|
|
|
|
|
|
def teardown
|
|
|
|
FileUtils.rm_rf @dir
|
2017-01-21 11:21:30 +00:00
|
|
|
super
|
2016-08-10 21:36:07 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_satisfied
|
|
|
|
with_environment("PATH" => @dir/"bin") do
|
|
|
|
assert_predicate GPG2Requirement.new, :satisfied?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|