diff options
-rw-r--r-- | spec/gitlab_shell_spec.rb | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb index 26ae957..d43ae01 100644 --- a/spec/gitlab_shell_spec.rb +++ b/spec/gitlab_shell_spec.rb @@ -22,19 +22,20 @@ describe GitlabShell do let(:git_config_options) { ['receive.MaxInputSize=10000'] } - let(:gitaly_check_access) { GitAccessStatus.new( - true, - HTTPCodes::HTTP_SUCCESS, - 'ok', - gl_repository: gl_repository, - gl_id: gl_id, - gl_username: gl_username, - git_config_options: git_config_options, - repository_path: repo_path, - gitaly: { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' }, - git_protocol: git_protocol - ) - } + let(:gitaly_check_access) do + GitAccessStatus.new( + true, + HTTPCodes::HTTP_SUCCESS, + 'ok', + gl_repository: gl_repository, + gl_id: gl_id, + gl_username: gl_username, + git_config_options: git_config_options, + repository_path: repo_path, + gitaly: { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' }, + git_protocol: git_protocol + ) + end let(:api) do double(GitlabNet).tap do |api| @@ -73,13 +74,13 @@ describe GitlabShell do allow_any_instance_of(GitlabConfig).to receive(:audit_usernames).and_return(false) end - describe :initialize do + describe '#initialize' do let(:ssh_cmd) { 'git-receive-pack' } it { expect(subject.gl_id).to eq gl_id } end - describe :parse_cmd do + describe '#parse_cmd' do describe 'git' do context 'w/o namespace' do let(:ssh_args) { %w(git-upload-pack gitlab-ci.git) } @@ -166,7 +167,7 @@ describe GitlabShell do end end - describe :exec do + describe '#exec' do let(:gitaly_message) do JSON.dump( 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default' }, @@ -448,7 +449,7 @@ describe GitlabShell do end end - describe :validate_access do + describe '#validate_access' do let(:ssh_cmd) { "git-upload-pack gitlab-ci.git" } describe 'check access with api' do @@ -496,7 +497,7 @@ describe GitlabShell do end end - describe :exec_cmd do + describe '#exec_cmd' do let(:shell) { GitlabShell.new(gl_id) } let(:env) do { @@ -604,7 +605,7 @@ describe GitlabShell do end end - describe :api do + describe '#api' do let(:shell) { GitlabShell.new(gl_id) } subject { shell.send :api } |