spec/mock_data_spec.rb in cistern-2.8.2 vs spec/mock_data_spec.rb in cistern-2.10.0

- old
+ new

@@ -49,23 +49,25 @@ context 'with a storage backend' do describe 'Cistern::Data::Hash' do include_examples 'mock_data#backend', :hash end - describe 'Cistern::Data::Redis' do - include_examples 'mock_data#backend', :redis + if ENV.key?('REDIS_URI') + describe 'Cistern::Data::Redis' do + include_examples 'mock_data#backend', :redis - context 'with an explicit client' do - before(:each) do - @other = Redis::Namespace.new('other_cistern', Redis.new) - @other.set('x', 'y') - end + context 'with an explicit client' do + before(:each) do + @other = Redis::Namespace.new('other_cistern', Redis.new) + @other.set('x', 'y') + end - include_examples 'mock_data#backend', :redis, client: Redis::Namespace.new('cistern', Redis.new) + include_examples 'mock_data#backend', :redis, client: Redis::Namespace.new('cistern', Redis.new) - after(:each) do - expect(@other.get('x')).to eq('y') - @other.del('x') + after(:each) do + expect(@other.get('x')).to eq('y') + @other.del('x') + end end end end end end