diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-04-03 15:27:14 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-04-03 18:45:36 +0200 |
commit | 09751c75ebaee03f5161c4e86f16a18a8f5b050f (patch) | |
tree | 59c3f9fe787f52b5e88293f649a7f89c4223d71c /spec | |
parent | 2fceb4374141407b2f41ed7b6af5a0b6a2f9f4f1 (diff) | |
download | gitlab-ce-09751c75ebaee03f5161c4e86f16a18a8f5b050f.tar.gz |
Add support for Gitaly calls over TCP connectionfeature/support-grpc-calls-over-tcp-conn
Closes gitaly#166
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 |