diff options
| author | Markus Reiter | 2017-03-08 16:35:02 +0100 | 
|---|---|---|
| committer | Markus Reiter | 2017-03-08 16:49:28 +0100 | 
| commit | 88bc68f3b5fb623e953b1103e211b6f7c77dbe1f (patch) | |
| tree | 2ab950eecb7e80a69d75170942f35ddd24f87cb4 /Library/Homebrew/test/cask/artifact/binary_spec.rb | |
| parent | ef02414888ec332aa4220fe05428f24b9a4f035f (diff) | |
| download | brew-88bc68f3b5fb623e953b1103e211b6f7c77dbe1f.tar.bz2 | |
Always `chmod +x` `binary` stanzas.
Diffstat (limited to 'Library/Homebrew/test/cask/artifact/binary_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/cask/artifact/binary_spec.rb | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/test/cask/artifact/binary_spec.rb b/Library/Homebrew/test/cask/artifact/binary_spec.rb index e503a3ebb..69bde3438 100644 --- a/Library/Homebrew/test/cask/artifact/binary_spec.rb +++ b/Library/Homebrew/test/cask/artifact/binary_spec.rb @@ -9,9 +9,11 @@ describe Hbc::Artifact::Binary, :cask do    let(:expected_path) {      Hbc.binarydir.join("binary")    } +    before(:each) do      Hbc.binarydir.mkpath    end +    after(:each) do      FileUtils.rm expected_path if expected_path.exist?    end @@ -24,6 +26,17 @@ describe Hbc::Artifact::Binary, :cask do      expect(expected_path.readlink).to exist    end +  it "makes the binary executable" do +    expect(FileUtils).to receive(:chmod).with("+x", cask.staged_path.join("binary")) + +    shutup do +      Hbc::Artifact::Binary.new(cask).install_phase +    end + +    expect(expected_path).to be_a_symlink +    expect(expected_path.readlink).to be_executable +  end +    it "avoids clobbering an existing binary by linking over it" do      FileUtils.touch expected_path  | 
