diff options
| author | Robert Speicher <robert@gitlab.com> | 2017-04-03 20:08:28 +0000 |
|---|---|---|
| committer | Robert Speicher <robert@gitlab.com> | 2017-04-03 20:08:28 +0000 |
| commit | e98536fb384d76ed7e13238bebbca91b682f5172 (patch) | |
| tree | 0b8adf6908b98b42e1ffad475fb05c1826a1fa5d /spec | |
| parent | 103a2a9ab94490722286cd8426668a9ce0749c29 (diff) | |
| parent | 09751c75ebaee03f5161c4e86f16a18a8f5b050f (diff) | |
| download | gitlab-ce-e98536fb384d76ed7e13238bebbca91b682f5172.tar.gz | |
Merge branch 'feature/support-grpc-calls-over-tcp-conn' into 'master'
Add support for Gitaly calls over TCP connection
Closes gitaly#166
See merge request !10410
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/lib/gitlab/gitaly_client_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client_spec.rb b/spec/lib/gitlab/gitaly_client_spec.rb new file mode 100644 index 00000000000..55fcf91fb6e --- /dev/null +++ b/spec/lib/gitlab/gitaly_client_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe Gitlab::GitalyClient, lib: true do + describe '.new_channel' do + context 'when passed a UNIX socket address' do + it 'passes the address as-is to GRPC::Core::Channel initializer' do + address = 'unix:/tmp/gitaly.sock' + + expect(GRPC::Core::Channel).to receive(:new).with(address, any_args) + + described_class.new_channel(address) + end + end + + context 'when passed a TCP address' do + it 'strips tcp:// prefix before passing it to GRPC::Core::Channel initializer' do + address = 'localhost:9876' + prefixed_address = "tcp://#{address}" + + expect(GRPC::Core::Channel).to receive(:new).with(address, any_args) + + described_class.new_channel(prefixed_address) + end + end + end +end |
