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
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-05 14:45:46 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-05 14:45:46 +0400
commitf1d8efb7700fb95b98924ffe2e65dd08f7f376c9 (patch)
treef1534c98525491abdbbfeafe21168996c304117c /spec
parent132c1b4c0ab54512e68eac68de322d8e4f8f59c4 (diff)
parentd6b0ac96f7b2952edb8aad0efcd48e0bccd23fe0 (diff)
Merge branch 'shell_new_style' into 'master'
Use new style shell commands
Diffstat (limited to 'spec')
-rw-r--r--spec/models/gollum_wiki_spec.rb6
-rw-r--r--spec/models/wiki_page_spec.rb6
-rw-r--r--spec/support/test_env.rb17
3 files changed, 9 insertions, 20 deletions
diff --git a/spec/models/gollum_wiki_spec.rb b/spec/models/gollum_wiki_spec.rb
index 9e07d9ee191..9b9d15b4ff4 100644
--- a/spec/models/gollum_wiki_spec.rb
+++ b/spec/models/gollum_wiki_spec.rb
@@ -2,12 +2,6 @@ require "spec_helper"
describe GollumWiki do
- def create_temp_repo(path)
- FileUtils.mkdir_p path
- command = "git init --quiet #{path};"
- system(command)
- end
-
def remove_temp_repo(path)
FileUtils.rm_rf path
end
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
index 67f2a6da42d..1c70edf0d4d 100644
--- a/spec/models/wiki_page_spec.rb
+++ b/spec/models/wiki_page_spec.rb
@@ -2,12 +2,6 @@ require "spec_helper"
describe WikiPage do
- def create_temp_repo(path)
- FileUtils.mkdir_p path
- command = "git init --quiet #{path};"
- system(command)
- end
-
def remove_temp_repo(path)
FileUtils.rm_rf path
end
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb
index 43aec1cd43d..77a669c0cc1 100644
--- a/spec/support/test_env.rb
+++ b/spec/support/test_env.rb
@@ -104,10 +104,12 @@ module TestEnv
def reset_satellite_dir
setup_stubs
- FileUtils.cd(seed_satellite_path) do
- `git reset --hard --quiet`
- `git clean -fx`
- `git checkout --quiet origin/master`
+ [
+ %W(git reset --hard --quiet),
+ %W(git clean -fx),
+ %W(git checkout --quiet origin/master)
+ ].each do |git_cmd|
+ system(*git_cmd, chdir: seed_satellite_path)
end
end
@@ -117,7 +119,7 @@ module TestEnv
repo = repo(namespace, name)
# Symlink tmp/repositories/gitlabhq to tmp/test-git-base-path/gitlabhq
- system("ln -s -f #{seed_repo_path()} #{repo}")
+ FileUtils.ln_sf(seed_repo_path, repo)
create_satellite(repo, namespace, name)
end
@@ -181,12 +183,11 @@ module TestEnv
# Symlink tmp/satellite/gitlabhq to tmp/test-git-base-path/satellite/gitlabhq, create the directory if it doesn't exist already
satellite_dir = File.dirname(satellite_repo)
FileUtils.mkdir_p(satellite_dir) unless File.exists?(satellite_dir)
- system("ln -s -f #{seed_satellite_path} #{satellite_repo}")
+ FileUtils.ln_sf(seed_satellite_path, satellite_repo)
end
def create_temp_repo(path)
FileUtils.mkdir_p path
- command = "git init --quiet --bare #{path};"
- system(command)
+ system(*%W(git init --quiet --bare -- #{path}))
end
end