require_relative 'spec_helper' require_relative '../lib/gitlab_config' describe GitlabConfig do let(:config) { GitlabConfig.new } describe :redis do before do config.instance_variable_set(:@config, YAML.load(< 'localhost', 'port' => 1123, 'bin' => '/usr/bin/redis-cli'} } end it { should be_an(Array) } it { should include(config.redis['host']) } it { should include(config.redis['bin']) } it { should include(config.redis['port'].to_s) } end context "with redis socket" do let(:socket) { '/tmp/redis.socket' } before do config.stub(:redis) { {'bin' => '', 'socket' => socket } } end it { should be_an(Array) } it { should include(socket) } it { should_not include('-p') } it { should_not include('-h') } end end end