From c334291259f988bf1d0efac2f710a14d4085da99 Mon Sep 17 00:00:00 2001
From: Luke Duncalfe <lduncalfe@gitlab.com>
Date: Tue, 5 Dec 2023 01:38:09 +0000
Subject: [PATCH] Test with file in temporary dir

---
 spec/lib/gitlab/utils/file_info_spec.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/spec/lib/gitlab/utils/file_info_spec.rb b/spec/lib/gitlab/utils/file_info_spec.rb
index 480036b2fd025..1f52fcb48b6eb 100644
--- a/spec/lib/gitlab/utils/file_info_spec.rb
+++ b/spec/lib/gitlab/utils/file_info_spec.rb
@@ -16,7 +16,7 @@
 
   describe '.linked?' do
     it 'raises an error when file does not exist' do
-      expect { subject.linked?('foo') }.to raise_error(Errno::ENOENT)
+      expect { subject.linked?("#{tmpdir}/foo") }.to raise_error(Errno::ENOENT)
     end
 
     shared_examples 'identifies a linked file' do
@@ -56,7 +56,7 @@
 
   describe '.shares_hard_link?' do
     it 'raises an error when file does not exist' do
-      expect { subject.shares_hard_link?('foo') }.to raise_error(Errno::ENOENT)
+      expect { subject.shares_hard_link?("#{tmpdir}/foo") }.to raise_error(Errno::ENOENT)
     end
 
     shared_examples 'identifies a file that shares a hard link' do
-- 
GitLab