summaryrefslogtreecommitdiff
path: root/spec/gitlab_shell_spec.rb
diff options
context:
space:
mode:
authorChristian Höltje <choltje@us.ibm.com>2013-03-15 13:15:27 -0400
committerChristian Höltje <choltje@us.ibm.com>2013-03-15 13:15:27 -0400
commit7d4780eca8dc964ac5b825b183a1fd73a074514e (patch)
tree64658918cbe5665f856b579d9008192c56f57b3f /spec/gitlab_shell_spec.rb
parentbc770be542009af7863ba6d4b33935836779aa81 (diff)
downloadgitlab-shell-7d4780eca8dc964ac5b825b183a1fd73a074514e.tar.gz
Randomize config.repos_path in tests
Diffstat (limited to 'spec/gitlab_shell_spec.rb')
-rw-r--r--spec/gitlab_shell_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb
index ef227ba..da91c36 100644
--- a/spec/gitlab_shell_spec.rb
+++ b/spec/gitlab_shell_spec.rb
@@ -16,12 +16,14 @@ describe GitlabShell do
end
end
let(:key_id) { "key-#{rand(100) + 100}" }
+ let(:repository_path) { "/home/git#{rand(100)}/repos" }
+ before { GitlabConfig.any_instance.stub(:repos_path).and_return(repository_path) }
describe :initialize do
before { ssh_cmd 'git-receive-pack' }
its(:key_id) { should == key_id }
- its(:repos_path) { should == "/home/git/repositories" }
+ its(:repos_path) { should == repository_path }
end
describe :parse_cmd do
@@ -56,7 +58,7 @@ describe GitlabShell do
end
it "should execute the command" do
- subject.should_receive(:exec_cmd).with("git-upload-pack /home/git/repositories/gitlab-ci.git")
+ subject.should_receive(:exec_cmd).with("git-upload-pack #{File.join(repository_path, 'gitlab-ci.git')}")
end
it "should set the GL_ID environment variable" do
@@ -73,7 +75,7 @@ describe GitlabShell do
end
it "should execute the command" do
- subject.should_receive(:exec_cmd).with("git-receive-pack /home/git/repositories/gitlab-ci.git")
+ subject.should_receive(:exec_cmd).with("git-receive-pack #{File.join(repository_path, 'gitlab-ci.git')}")
end
end