summaryrefslogtreecommitdiff
path: root/spec/gitlab_shell_spec.rb
diff options
context:
space:
mode:
authorChristian Höltje <choltje@us.ibm.com>2013-03-15 13:06:34 -0400
committerChristian Höltje <choltje@us.ibm.com>2013-03-15 13:06:34 -0400
commite794bdf37503360094e6414bb931dbf135e636ca (patch)
tree2145acfc3d75cf94d1fc7bfca40d60943f85a6c5 /spec/gitlab_shell_spec.rb
parent0c6686b6e129db9086ac3fe0e896c892fe73f428 (diff)
downloadgitlab-shell-e794bdf37503360094e6414bb931dbf135e636ca.tar.gz
Use Kernel::exec instead of system()
We don't need to keep the ruby process around once we've established that it's ok to run a git command.
Diffstat (limited to 'spec/gitlab_shell_spec.rb')
-rw-r--r--spec/gitlab_shell_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb
index 51e02dd..2fa44a9 100644
--- a/spec/gitlab_shell_spec.rb
+++ b/spec/gitlab_shell_spec.rb
@@ -5,7 +5,7 @@ describe GitlabShell do
subject do
ARGV[0] = 'key-56'
GitlabShell.new.tap do |shell|
- shell.stub(process_cmd: true)
+ shell.stub(exec_cmd: :exec_called)
shell.stub(api: api)
end
end
@@ -53,6 +53,10 @@ describe GitlabShell do
it "should process the command" do
subject.should_receive(:process_cmd).with()
end
+
+ it "should execute the command" do
+ subject.should_receive(:exec_cmd).with("git-upload-pack /home/git/repositories/gitlab-ci.git")
+ end
end
context 'git-receive-pack' do
@@ -62,6 +66,10 @@ describe GitlabShell do
it "should process the command" do
subject.should_receive(:process_cmd).with()
end
+
+ it "should execute the command" do
+ subject.should_receive(:exec_cmd).with("git-receive-pack /home/git/repositories/gitlab-ci.git")
+ end
end
context 'arbitrary command' do
@@ -71,6 +79,10 @@ describe GitlabShell do
it "should not process the command" do
subject.should_not_receive(:process_cmd)
end
+
+ it "should not execute the command" do
+ subject.should_not_receive(:exec_cmd)
+ end
end
context 'no command' do