aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/gpg2_requirement_test.rb
blob: fa7fc9ea41d3301df7500e332441240efd699177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require "testing_env"
require "requirements/gpg2_requirement"
require "fileutils"

class GPG2RequirementTests < Homebrew::TestCase
  def setup
    @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
  end

  def test_satisfied
    with_environment("PATH" => @dir/"bin") do
      assert_predicate GPG2Requirement.new, :satisfied?
    end
  end
end