From 02522fe410c405fea8738004a9144ee6c840f4d2 Mon Sep 17 00:00:00 2001 From: Gabriel Burt Date: Mon, 30 Mar 2015 20:02:56 -0500 Subject: [PATCH] add #subscribed? to helpers called w/o namespace --- lib/redis/namespace.rb | 1 + spec/redis_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/redis/namespace.rb b/lib/redis/namespace.rb index fa3b34d..ba8e138 100644 --- a/lib/redis/namespace.rb +++ b/lib/redis/namespace.rb @@ -194,6 +194,7 @@ class Namespace "echo" => [], "ping" => [], "disconnect!" => [], + "subscribed?" => [], } ADMINISTRATIVE_COMMANDS = { "bgrewriteaof" => [], diff --git a/spec/redis_spec.rb b/spec/redis_spec.rb index 885b4dc..5833f4f 100644 --- a/spec/redis_spec.rb +++ b/spec/redis_spec.rb @@ -343,6 +343,12 @@ expect(@namespaced.disconnect!).to be nil end + it 'should not add namespace to subscribed?' do + expect(@redis).to receive(:subscribed?).with().and_call_original + + expect(@namespaced.subscribed?).to be false + end + it "can change its namespace" do @namespaced['foo'].should eq(nil) @namespaced['foo'] = 'chris'