diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-04-02 17:11:15 +1100 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2019-04-04 13:32:30 +1100 |
commit | 5cd13175c94912651202a61ab755cfead33a3ee9 (patch) | |
tree | b69113a89dc6f80cafaca5dfaa0dc9c63873bb2f /spec/gitlab_shell_spec.rb | |
parent | 02088137c28f7b822a7d979f985ca38f3e0583ef (diff) | |
download | gitlab-shell-5cd13175c94912651202a61ab755cfead33a3ee9.tar.gz |
Print console messages to $stderr if present9217-warn-on-git-fetch-over-ssh-if-the-secondary-is-lagging-the-primary
Using ConsoleHelper::write_stderr
Diffstat (limited to 'spec/gitlab_shell_spec.rb')
-rw-r--r-- | spec/gitlab_shell_spec.rb | 17 |
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 |