Skip to content

Commit

Permalink
Merge pull request #1 from Syft-Application/FIX_srem_namespacing
Browse files Browse the repository at this point in the history
FIX missing namespaced srem? method
  • Loading branch information
neilchandler authored May 24, 2023
2 parents 7fd8ad2 + b724dfc commit d442c91
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 d442c91

Please sign in to comment.