Use explicit checks instead of custom matcher.

This commit is contained in:
Markus Reiter 2017-02-09 19:01:46 +01:00
parent 6cd3642850
commit 31c51108ce
3 changed files with 4 additions and 12 deletions

View File

@ -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

View File

@ -34,5 +34,4 @@ end
RSpec.configure do |config|
config.order = :random
config.include(Test::Helper::Shutup)
config.include(FileMatchers)
end

View File

@ -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