summaryrefslogtreecommitdiff
path: root/spec/gitlab_shell_spec.rb
diff options
context:
space:
mode:
authorGabor Nagy <mail@aigeruth.hu>2014-06-22 22:45:06 +0200
committerGabor Nagy <mail@aigeruth.hu>2014-06-23 20:52:45 +0200
commit32f1893298bc0108df89de0e543193af20bb0e7c (patch)
tree2fcff9cc992f4560be894f41938573ef3e6bb15e /spec/gitlab_shell_spec.rb
parentca425566d0266a1786019153757e283d7d246450 (diff)
downloadgitlab-shell-32f1893298bc0108df89de0e543193af20bb0e7c.tar.gz
Improve coverage.
Diffstat (limited to 'spec/gitlab_shell_spec.rb')
-rw-r--r--spec/gitlab_shell_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb
index 3243dd3..6a00638 100644
--- a/spec/gitlab_shell_spec.rb
+++ b/spec/gitlab_shell_spec.rb
@@ -145,6 +145,31 @@ describe GitlabShell do
end
end
+ describe :exec_cmd do
+ let(:shell) { GitlabShell.new }
+ before { Kernel.stub!(:exec) }
+
+ it "uses Kernel::exec method" do
+ Kernel.should_receive(:exec).with(kind_of(Hash), 1, unsetenv_others: true).once
+ shell.send :exec_cmd, 1
+ end
+ end
+
+ describe :api do
+ let(:shell) { GitlabShell.new }
+ subject { shell.send :api }
+
+ it { should be_a(GitlabNet) }
+ end
+
+ describe :escape_path do
+ let(:shell) { GitlabShell.new }
+ before { File.stub(:absolute_path) { 'y' } }
+ subject { -> { shell.send(:escape_path, 'z') } }
+
+ it { should raise_error(RuntimeError, "Wrong repository path") }
+ end
+
def ssh_cmd(cmd)
ENV['SSH_ORIGINAL_COMMAND'] = cmd
end