summaryrefslogtreecommitdiff
path: root/spec/support/helpers/redis_without_keys.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/redis_without_keys.rb')
-rw-r--r--spec/support/helpers/redis_without_keys.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/helpers/redis_without_keys.rb b/spec/support/helpers/redis_without_keys.rb
new file mode 100644
index 00000000000..6220167dee6
--- /dev/null
+++ b/spec/support/helpers/redis_without_keys.rb
@@ -0,0 +1,8 @@
+class Redis
+ ForbiddenCommand = Class.new(StandardError)
+
+ def keys(*args)
+ raise ForbiddenCommand.new("Don't use `Redis#keys` as it iterates over all "\
+ "keys in redis. Use `Redis#scan_each` instead.")
+ end
+end