Skip to content

Commit

Permalink
Fix srem? not being namespaced
Browse files Browse the repository at this point in the history
  • Loading branch information
jdelStrother authored and PatrickTulskie committed May 25, 2023
1 parent 7fd8ad2 commit 0826717
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/redis/namespace.rb
Expand Up @@ -138,7 +138,7 @@ class Namespace
"rpush" => [ :first ],
"rpushx" => [ :first ],
"sadd" => [ :first ],
"sadd?" => [ :first ],
"sadd?" => [ :first ],
"scard" => [ :first ],
"scan" => [ :scan_style, :second ],
"scan_each" => [ :scan_style, :all ],
Expand All @@ -159,6 +159,7 @@ class Namespace
"spop" => [ :first ],
"srandmember" => [ :first ],
"srem" => [ :first ],
"srem?" => [ :first ],
"sscan" => [ :first ],
"sscan_each" => [ :first ],
"strlen" => [ :first ],
Expand Down
6 changes: 6 additions & 0 deletions spec/redis_spec.rb
Expand Up @@ -363,6 +363,12 @@
expect(@namespaced.sadd?('foo', 1)).to eq(false)
end

it "should remove members" do
@namespaced.sadd('foo', 1)
expect(@namespaced.srem?('foo', 1)).to eq(true)
expect(@namespaced.srem?('foo', 1)).to eq(false)
end

it "should add namespace to sort" do
@namespaced.sadd('foo', 1)
@namespaced.sadd('foo', 2)
Expand Down

0 comments on commit 0826717

Please sign in to comment.