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

describe GPG2Requirement do
  let(:dir) { @dir = Pathname.new(Dir.mktmpdir) }

  after(:each) do
    FileUtils.rm_rf dir unless @dir.nil?
  end

  describe "#satisfied?" do
    it "returns true if GPG2 is installed" do
      ENV["PATH"] = dir/"bin"
      (dir/"bin/gpg").write <<-EOS.undent
        #!/bin/bash
        echo 2.0.30
      EOS
      FileUtils.chmod 0755, dir/"bin/gpg"

      expect(subject).to be_satisfied
    end
  end
end