summaryrefslogtreecommitdiff
path: root/spec/gitlab_shell_spec.rb
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-04-02 17:11:15 +1100
committerAsh McKenzie <amckenzie@gitlab.com>2019-04-04 13:32:30 +1100
commit5cd13175c94912651202a61ab755cfead33a3ee9 (patch)
treeb69113a89dc6f80cafaca5dfaa0dc9c63873bb2f /spec/gitlab_shell_spec.rb
parent02088137c28f7b822a7d979f985ca38f3e0583ef (diff)
downloadgitlab-shell-5cd13175c94912651202a61ab755cfead33a3ee9.tar.gz
Using ConsoleHelper::write_stderr
Diffstat (limited to 'spec/gitlab_shell_spec.rb')
-rw-r--r--spec/gitlab_shell_spec.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb
index c261e6f..6a059aa 100644
--- a/spec/gitlab_shell_spec.rb
+++ b/spec/gitlab_shell_spec.rb
@@ -33,7 +33,8 @@ describe GitlabShell do
gl_username: gl_username,
git_config_options: git_config_options,
gitaly: { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' },
- git_protocol: git_protocol
+ git_protocol: git_protocol,
+ gl_console_messages: gl_console_messages
)
end
@@ -69,6 +70,7 @@ describe GitlabShell do
let(:gl_username) { 'testuser' }
let(:git_config_options) { ['receive.MaxInputSize=10000'] }
let(:git_protocol) { 'version=2' }
+ let(:gl_console_messages) { nil }
before do
allow_any_instance_of(GitlabConfig).to receive(:audit_usernames).and_return(false)
@@ -438,6 +440,19 @@ describe GitlabShell do
end
end
end
+
+ context 'with a console message' do
+ let(:ssh_cmd) { "git-receive-pack gitlab-ci.git" }
+ let(:gl_console_messages) { 'Very important message' }
+
+ before do
+ allow(api).to receive(:check_access).and_return(gitaly_check_access)
+ end
+
+ it 'displays the message on $stderr' do
+ expect { subject.exec(ssh_cmd) }.to output("> GitLab: #{gl_console_messages}\n").to_stderr
+ end
+ end
end
describe '#validate_access' do