From b1dd9fc48cf72160466e9e871eb13b5aad31329a Mon Sep 17 00:00:00 2001 From: James Herdman Date: Mon, 25 Apr 2022 14:17:49 -0400 Subject: [PATCH] Reproduction test case --- spec/database_cleaner/redis/deletion_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/database_cleaner/redis/deletion_spec.rb b/spec/database_cleaner/redis/deletion_spec.rb index e14d5f4..26ddb1d 100644 --- a/spec/database_cleaner/redis/deletion_spec.rb +++ b/spec/database_cleaner/redis/deletion_spec.rb @@ -41,6 +41,15 @@ expect(@redis.get('Gadget')).to eq '1' end end + + context "with wildcard keys and no matches in Redis DB" do + subject { described_class.new(only: ["test*"]) } + + it "only deletes the specified keys" do + subject.clean + expect(@redis.keys).to match_array(["Widget", "Gadget"]) + end + end end context "with the :except option" do