diff options
Diffstat (limited to 'spec/support/shared_examples/redis/redis_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/redis/redis_shared_examples.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/shared_examples/redis/redis_shared_examples.rb b/spec/support/shared_examples/redis/redis_shared_examples.rb index b9179261f87..1c153b7c31b 100644 --- a/spec/support/shared_examples/redis/redis_shared_examples.rb +++ b/spec/support/shared_examples/redis/redis_shared_examples.rb @@ -185,6 +185,17 @@ RSpec.shared_examples "redis_shared_examples" do end end + context 'when the parsed external command output returns invalid hash' do + before do + allow(Gitlab::Popen).to receive(:popen).and_return(["hello", 0]) + end + + it 'raises an error' do + expect { subject }.to raise_error(Gitlab::Redis::Wrapper::CommandExecutionError, + %r{Redis: The output of `/opt/redis-config.sh` must be a Hash, String given}) + end + end + context 'when the command fails' do before do allow(Gitlab::Popen).to receive(:popen).and_return(["", 125]) |