diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2016-08-18 13:10:16 +0200 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2016-08-18 13:10:16 +0200 |
commit | 3c49cb0287e4d1ecc52efa43d66183b5a49a318d (patch) | |
tree | 07dde327ad422fbf4000fe1d06a821a29ed87ea0 /spec/gitlab_net_spec.rb | |
parent | 0a24df3371c4af2a2b1e6a61a3048c80cd51536c (diff) | |
download | gitlab-shell-3c49cb0287e4d1ecc52efa43d66183b5a49a318d.tar.gz |
Added specs for sentinel support
Diffstat (limited to 'spec/gitlab_net_spec.rb')
-rw-r--r-- | spec/gitlab_net_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/gitlab_net_spec.rb b/spec/gitlab_net_spec.rb index 2bbf98b..2cb97cb 100644 --- a/spec/gitlab_net_spec.rb +++ b/spec/gitlab_net_spec.rb @@ -306,6 +306,20 @@ describe GitlabNet, vcr: true do end end + context "with sentinels" do + it 'users the specified sentinels' do + allow(gitlab_net).to receive(:config).and_return(config) + allow(config).to receive(:redis).and_return({ 'host' => 'localhost', 'port' => 1123, + 'sentinels' => [{'host' => '127.0.0.1', 'port' => 26380}] }) + + expect_any_instance_of(Redis).to receive(:initialize).with({ host: 'localhost', + port: 1123, + db: 0, + sentinels: [{host: '127.0.0.1', port: 26380}] }).and_call_original + gitlab_net.redis_client + end + end + context "with redis socket" do let(:socket) { '/tmp/redis.socket' } |