summaryrefslogtreecommitdiff
path: root/spec/support/import_export/common_util.rb
blob: 2542a59bb00d019f0b4502e31e0c3193d4f32393 (plain)
1
2
3
4
5
6
7
8
9
10
module ImportExport
  module CommonUtil
    def setup_symlink(tmpdir, symlink_name)
      allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(tmpdir)

      File.open("#{tmpdir}/test", 'w') { |file| file.write("test") }
      FileUtils.ln_s("#{tmpdir}/test", "#{tmpdir}/#{symlink_name}")
    end
  end
end