spec/models/rspeed/redis/destroy_spec.rb in rspeed-0.5.2 vs spec/models/rspeed/redis/destroy_spec.rb in rspeed-0.6.0
- old
+ new
@@ -1,29 +1,21 @@
# frozen_string_literal: true
RSpec.describe RSpeed::Redis, '#destroy' do
- let!(:redis) { described_class }
-
before do
- redis.set('rspeed', '{}')
- redis.set('rspeed_1', '{}')
- redis.set('rspeed_2', '{}')
+ redis_object.set('rspeed', '{}')
+ redis_object.set('rspeed_1', '{}')
+ redis_object.set('rspeed_2', '{}')
end
it 'destroys via wildcard' do
- redis.destroy('rspeed_*')
+ described_class.destroy(pattern: 'rspeed_*')
- expect(redis.keys('*')).to eq %w[rspeed]
+ expect(redis_object.keys('*')).to eq %w[rspeed]
end
it 'destroys via single name' do
- redis.destroy('rspeed')
+ described_class.destroy(pattern: 'rspeed')
- expect(redis.keys('*')).to eq %w[rspeed_1 rspeed_2]
- end
-
- it 'destroys default partner when no pattern is given' do
- redis.destroy
-
- expect(redis.keys('*')).to eq %w[rspeed]
+ expect(redis_object.keys('*')).to eq %w[rspeed_1 rspeed_2]
end
end