Skip to content
Snippets Groups Projects
Commit 31c51108 authored by Markus Reiter's avatar Markus Reiter
Browse files

Use explicit checks instead of custom matcher.

parent 6cd36428
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -34,5 +34,4 @@ end
RSpec.configure do |config|
config.order = :random
config.include(Test::Helper::Shutup)
config.include(FileMatchers)
end
module FileMatchers
extend RSpec::Matchers::DSL
matcher :be_a_valid_symlink do
match do |path|
path.symlink? && path.readlink.exist?
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment