Skip to content

Commit

Permalink
Support for bitfield command
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasfed authored and PatrickTulskie committed Jul 25, 2023
1 parent 313909f commit 7829923
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/redis/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Namespace
NAMESPACED_COMMANDS = {
"append" => [ :first ],
"bitcount" => [ :first ],
"bitfield" => [ :first ],
"bitop" => [ :exclude_first ],
"bitpos" => [ :first ],
"blpop" => [ :exclude_last, :first ],
Expand Down
7 changes: 7 additions & 0 deletions spec/redis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,13 @@
end
end

if @redis_version >= Gem::Version.new("3.2.0")
it 'should namespace bitfield' do
@namespaced.bitfield("bf", "SET", "i8", 0, "A".ord)
expect(@redis.get("ns:bf")).to eq("A")
end
end

describe :full_namespace do
it "should return the full namespace including sub namespaces" do
sub_namespaced = Redis::Namespace.new(:sub1, :redis => @namespaced)
Expand Down

0 comments on commit 7829923

Please sign in to comment.