summaryrefslogtreecommitdiff
path: root/spec/gitlab_shell_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/gitlab_shell_spec.rb')
-rw-r--r--spec/gitlab_shell_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb
index 051cac4..86d72f4 100644
--- a/spec/gitlab_shell_spec.rb
+++ b/spec/gitlab_shell_spec.rb
@@ -236,6 +236,15 @@ describe GitlabShell do
Kernel.should_receive(:exec).with(kind_of(Hash), 1, 2, unsetenv_others: true).once
shell.send :exec_cmd, 1, 2
end
+
+ it "refuses to execute a lone non-array argument" do
+ expect { shell.send :exec_cmd, 1 }.to raise_error(GitlabShell::DisallowedCommandError)
+ end
+
+ it "allows one argument if it is an array" do
+ Kernel.should_receive(:exec).with(kind_of(Hash), [1, 2], unsetenv_others: true).once
+ shell.send :exec_cmd, [1, 2]
+ end
end
describe :api do