Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-10-26 15:04:31 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-11-01 17:11:07 +0300
commit9c8bf27f020278fe20ddb20572c61e4999070481 (patch)
tree2d5b3e5c5ba40983c63dd507840667149f82833a /spec/support
parent2e0bd8088c69e33f29cfc94e892683f322d5159e (diff)
Removes any symlinks before importing a project export file. Also added relevant spec.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/import_export/common_util.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/import_export/common_util.rb b/spec/support/import_export/common_util.rb
new file mode 100644
index 00000000000..2542a59bb00
--- /dev/null
+++ b/spec/support/import_export/common_util.rb
@@ -0,0 +1,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