From 31c51108ce43ae97f6b8c061be90ccc1a567010b Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 9 Feb 2017 19:01:46 +0100 Subject: [PATCH] Use explicit checks instead of custom matcher. --- Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb | 6 ++++-- Library/Homebrew/cask/spec/spec_helper.rb | 1 - Library/Homebrew/cask/spec/support/file_matchers.rb | 9 --------- 3 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 Library/Homebrew/cask/spec/support/file_matchers.rb diff --git a/Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb b/Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb index b606aba1b6..c27dcc8f0f 100644 --- a/Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb +++ b/Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb @@ -20,7 +20,8 @@ describe Hbc::Artifact::Binary do shutup do Hbc::Artifact::Binary.new(cask).install_phase end - expect(expected_path).to be_a_valid_symlink + expect(expected_path).to be_a_symlink + expect(expected_path.readlink).to exist end it "avoids clobbering an existing binary by linking over it" do @@ -82,7 +83,8 @@ describe Hbc::Artifact::Binary do Hbc::Artifact::Binary.new(cask).install_phase end - expect(expected_path).to be_a_valid_symlink + expect(expected_path).to be_a_symlink + expect(expected_path.readlink).to exist end end end diff --git a/Library/Homebrew/cask/spec/spec_helper.rb b/Library/Homebrew/cask/spec/spec_helper.rb index 548691f19c..eefee3d60e 100644 --- a/Library/Homebrew/cask/spec/spec_helper.rb +++ b/Library/Homebrew/cask/spec/spec_helper.rb @@ -34,5 +34,4 @@ end RSpec.configure do |config| config.order = :random config.include(Test::Helper::Shutup) - config.include(FileMatchers) end diff --git a/Library/Homebrew/cask/spec/support/file_matchers.rb b/Library/Homebrew/cask/spec/support/file_matchers.rb deleted file mode 100644 index d3e62f45af..0000000000 --- a/Library/Homebrew/cask/spec/support/file_matchers.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FileMatchers - extend RSpec::Matchers::DSL - - matcher :be_a_valid_symlink do - match do |path| - path.symlink? && path.readlink.exist? - end - end -end