spec/models/rspeed/redis/keys_spec.rb in rspeed-0.5.2 vs spec/models/rspeed/redis/keys_spec.rb in rspeed-0.6.0

- old
+ new

@@ -1,29 +1,13 @@ # frozen_string_literal: true RSpec.describe RSpeed::Redis, '.keys' do - subject(:redis) { described_class } - - context 'with default config' do - before do - described_class.set('rspeed_1', 'value_1') - described_class.set('rspeed_2', 'value_2') - described_class.set('rspeed_3', 'value_3') - end - - it 'shows keys' do - expect(redis.keys).to eq %w[rspeed_1 rspeed_2 rspeed_3] - end + before do + redis_object.set('custom_key_1', 'value_1') + redis_object.set('custom_key_2', 'value_2') + redis_object.set('custom_key_3', 'value_3') end - context 'with custom key' do - before do - described_class.set('custom_key_1', 'value_1') - described_class.set('custom_key_2', 'value_2') - described_class.set('custom_key_3', 'value_3') - end - - it 'shows keys' do - expect(redis.keys('custom_key_*')).to eq %w[custom_key_1 custom_key_2 custom_key_3] - end + it 'shows keys' do + expect(described_class.keys(pattern: 'custom_key_*')).to eq %w[custom_key_1 custom_key_2 custom_key_3] end end