diff -Nru ruby-fakeredis-0.8.0/debian/changelog ruby-fakeredis-0.8.0/debian/changelog --- ruby-fakeredis-0.8.0/debian/changelog 2021-11-15 11:10:57.000000000 +0000 +++ ruby-fakeredis-0.8.0/debian/changelog 2022-04-04 22:01:54.000000000 +0000 @@ -1,3 +1,24 @@ +ruby-fakeredis (0.8.0-7) unstable; urgency=medium + + * Team upload. + * Require ruby-redis >= 4.5 for runtime and tests + + -- Cédric Boutillier Tue, 05 Apr 2022 00:01:54 +0200 + +ruby-fakeredis (0.8.0-6) unstable; urgency=medium + + * Team upload + * Add patch to make testsuite pass with ruby-redis 4.5.1 (Closes: #1002985) + + Patch: exists command must return an int + + Patch: skip failing test checking that 'del' command with parameter + should return an error + * Drop unused patch b594709a3209aa671db2c6ebd8bac4a256a46ee2.patch + (duplicate of Fix_tests_for_Ruby_2.7+_compatibility.patch) + * Bump Standards-Version to 4.6.0 (no changes needed) + * Update years in copyright file + + -- Cédric Boutillier Sun, 27 Mar 2022 23:38:08 +0200 + ruby-fakeredis (0.8.0-5) unstable; urgency=medium * Team upload. diff -Nru ruby-fakeredis-0.8.0/debian/control ruby-fakeredis-0.8.0/debian/control --- ruby-fakeredis-0.8.0/debian/control 2021-11-15 11:10:57.000000000 +0000 +++ ruby-fakeredis-0.8.0/debian/control 2022-04-04 22:01:54.000000000 +0000 @@ -5,9 +5,9 @@ Uploaders: Abhijith PA Build-Depends: debhelper-compat (= 13), gem2deb, - ruby-redis (>= 4~), + ruby-redis (>= 4.5~), ruby-rspec -Standards-Version: 4.5.1 +Standards-Version: 4.6.0 Vcs-Git: https://salsa.debian.org/ruby-team/ruby-fakeredis.git Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-fakeredis Homepage: https://github.com/guilleiguaran/fakeredis @@ -18,7 +18,7 @@ Package: ruby-fakeredis Architecture: all XB-Ruby-Versions: ${ruby:Versions} -Depends: ruby-redis (>= 4~), +Depends: ruby-redis (>= 4.5~), ${misc:Depends}, ${shlibs:Depends}, ${ruby:Depends} diff -Nru ruby-fakeredis-0.8.0/debian/copyright ruby-fakeredis-0.8.0/debian/copyright --- ruby-fakeredis-0.8.0/debian/copyright 2021-11-15 11:10:57.000000000 +0000 +++ ruby-fakeredis-0.8.0/debian/copyright 2022-04-04 22:01:54.000000000 +0000 @@ -3,11 +3,11 @@ Source: https://guilleiguaran.github.com/fakeredis Files: * -Copyright: 2015 Guillermo Iguaran +Copyright: 2011-2018 Guillermo Iguaran License: Expat Files: debian/* -Copyright: 2015 Abhijith PA +Copyright: 2015-2022 Abhijith PA License: Expat Comment: the Debian packaging is licensed under the same terms as the original package. diff -Nru ruby-fakeredis-0.8.0/debian/patches/b594709a3209aa671db2c6ebd8bac4a256a46ee2.patch ruby-fakeredis-0.8.0/debian/patches/b594709a3209aa671db2c6ebd8bac4a256a46ee2.patch --- ruby-fakeredis-0.8.0/debian/patches/b594709a3209aa671db2c6ebd8bac4a256a46ee2.patch 2021-11-15 11:10:57.000000000 +0000 +++ ruby-fakeredis-0.8.0/debian/patches/b594709a3209aa671db2c6ebd8bac4a256a46ee2.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,183 +0,0 @@ -From b594709a3209aa671db2c6ebd8bac4a256a46ee2 Mon Sep 17 00:00:00 2001 -From: Denise Yu -Date: Mon, 24 Aug 2020 17:40:19 -0400 -Subject: [PATCH] Fix tests for Ruby 2.7+ compatibility - ---- - spec/keys_spec.rb | 18 +++++++++--------- - spec/memory_spec.rb | 2 +- - spec/sorted_sets_spec.rb | 32 ++++++++++++++++---------------- - 3 files changed, 26 insertions(+), 26 deletions(-) - -diff --git a/spec/keys_spec.rb b/spec/keys_spec.rb -index 5dfe423..5f5a89a 100644 ---- a/spec/keys_spec.rb -+++ b/spec/keys_spec.rb -@@ -362,14 +362,14 @@ module FakeRedis - it "uses ex option to set the expire time, in seconds" do - ttl = 7 - -- expect(@client.set("key1", "1", { :ex => ttl })).to eq("OK") -+ expect(@client.set("key1", "1", ex: ttl)).to eq("OK") - expect(@client.ttl("key1")).to eq(ttl) - end - - it "uses px option to set the expire time, in miliseconds" do - ttl = 7000 - -- expect(@client.set("key1", "1", { :px => ttl })).to eq("OK") -+ expect(@client.set("key1", "1", px: ttl)).to eq("OK") - expect(@client.ttl("key1")).to eq(ttl / 1000) - end - -@@ -379,30 +379,30 @@ module FakeRedis - ttl_px = 6000 - ttl_ex = 10 - -- @client.set("key1", "1", { :px => ttl_px, :ex => ttl_ex }) -+ @client.set("key1", "1", px: ttl_px, ex: ttl_ex) - expect(@client.ttl("key1")).to eq(ttl_px / 1000) - -- @client.set("key1", "1", { :ex => ttl_ex, :px => ttl_px }) -+ @client.set("key1", "1", ex: ttl_ex, px: ttl_px) - expect(@client.ttl("key1")).to eq(ttl_px / 1000) - end - - it "uses nx option to only set the key if it does not already exist" do -- expect(@client.set("key1", "1", { :nx => true })).to eq(true) -- expect(@client.set("key1", "2", { :nx => true })).to eq(false) -+ expect(@client.set("key1", "1", nx: true)).to eq(true) -+ expect(@client.set("key1", "2", nx: true)).to eq(false) - - expect(@client.get("key1")).to eq("1") - end - - it "uses xx option to only set the key if it already exists" do -- expect(@client.set("key2", "1", { :xx => true })).to eq(false) -+ expect(@client.set("key2", "1", xx: true)).to eq(false) - @client.set("key2", "2") -- expect(@client.set("key2", "1", { :xx => true })).to eq(true) -+ expect(@client.set("key2", "1", xx: true)).to eq(true) - - expect(@client.get("key2")).to eq("1") - end - - it "does not set the key if both xx and nx option are specified" do -- expect(@client.set("key2", "1", { :nx => true, :xx => true })).to eq(false) -+ expect(@client.set("key2", "1", nx: true, xx: true)).to eq(false) - expect(@client.get("key2")).to be_nil - end - end -diff --git a/spec/memory_spec.rb b/spec/memory_spec.rb -index f692f14..8520e6b 100644 ---- a/spec/memory_spec.rb -+++ b/spec/memory_spec.rb -@@ -21,7 +21,7 @@ def result - cursor = 0 - - loop do -- cursor, keys = redis.scan(cursor, match_arguments) -+ cursor, keys = redis.scan(cursor, **match_arguments) - returned_keys += keys - break if cursor == '0' - end -diff --git a/spec/sorted_sets_spec.rb b/spec/sorted_sets_spec.rb -index f74f55d..230924e 100644 ---- a/spec/sorted_sets_spec.rb -+++ b/spec/sorted_sets_spec.rb -@@ -685,13 +685,13 @@ module FakeRedis - context "with {nx: true, incr: true}" do - let(:options) { {nx: true, incr: true} } - it "should increment to the provided score only if the element is new and return the element's score" do -- expect(@client.zadd("key", 1, "first", options)).to eq(1.0) -+ expect(@client.zadd("key", 1, "first", **options)).to eq(1.0) - expect(@client.zscore("key", "first")).to eq(1.0) - -- expect(@client.zadd("key", 2, "second", options)).to eq(2.0) -+ expect(@client.zadd("key", 2, "second", **options)).to eq(2.0) - expect(@client.zscore("key", "second")).to eq(2.0) - -- expect(@client.zadd("key", 99, "first", options)).to be_nil -+ expect(@client.zadd("key", 99, "first", **options)).to be_nil - expect(@client.zscore("key", "first")).to eq(1.0) - end - end -@@ -699,11 +699,11 @@ module FakeRedis - context "with {nx: true, ch: true}" do - let(:options) { {nx: true, ch: true} } - it "should add only new elements, not update existing elements, and return the number of added elements" do -- expect(@client.zadd("key", 1, "first", options)).to eq(true) -- expect(@client.zadd("key", 1, "first", options)).to eq(false) -+ expect(@client.zadd("key", 1, "first", **options)).to eq(true) -+ expect(@client.zadd("key", 1, "first", **options)).to eq(false) - - # add two new elements -- expect(@client.zadd("key", [99, "first", 2, "second", 3, "third"], options)).to eq(2) -+ expect(@client.zadd("key", [99, "first", 2, "second", 3, "third"], **options)).to eq(2) - expect(@client.zscore("key", "first")).to eq(1.0) - end - end -@@ -712,19 +712,19 @@ module FakeRedis - let(:options) { {nx: true, incr: true, ch: true} } - - it "should add only new elements" do -- expect(@client.zadd("key", 1, "first", options)).to eq(1.0) -- expect(@client.zadd("key", 99, "first", options)).to be_nil -+ expect(@client.zadd("key", 1, "first", **options)).to eq(1.0) -+ expect(@client.zadd("key", 99, "first", **options)).to be_nil - expect(@client.zscore("key", "first")).to eq(1.0) - end - - # when INCR is present, return value is always the new score of member - it "should return the score of the new member" do -- expect(@client.zadd("key", 2, "second", options)).to eq(2.0) -+ expect(@client.zadd("key", 2, "second", **options)).to eq(2.0) - end - - it "should return nil when the member already exists" do - @client.zadd("key", 1, "first") -- expect(@client.zadd("key", 99, "first", options)).to be_nil -+ expect(@client.zadd("key", 99, "first", **options)).to be_nil - end - end - -@@ -733,12 +733,12 @@ module FakeRedis - before { @client.zadd("key", 1, "existing") } - - it "should return nil if the member does not already exist" do -- expect(@client.zadd("key", 1, "new1", options)).to be_nil -+ expect(@client.zadd("key", 1, "new1", **options)).to be_nil - expect(@client.zscore("key", "new1")).to be_nil - end - - it "should increment only existing elements" do -- expect(@client.zadd("key", [11, "existing"], options)).to eq(12.0) -+ expect(@client.zadd("key", [11, "existing"], **options)).to eq(12.0) - expect(@client.zscore("key", "existing")).to eq(12.0) - end - end -@@ -748,8 +748,8 @@ module FakeRedis - it "should return the number of updated elements and not add new members" do - @client.zadd("key", 1, "first") - -- expect(@client.zadd("key", 99, "first", options)).to eq(true) -- expect(@client.zadd("key", [100, "first", 2, "second"], options)).to eq(1.0) -+ expect(@client.zadd("key", 99, "first", **options)).to eq(true) -+ expect(@client.zadd("key", [100, "first", 2, "second"], **options)).to eq(1.0) - expect(@client.zscore("key", "second")).to be_nil - end - end -@@ -760,11 +760,11 @@ module FakeRedis - - # when INCR is present, return value is always the new score of member - it "should return the new score of the inserted member" do -- expect(@client.zadd("key", 2, "existing", options)).to eq(3.0) -+ expect(@client.zadd("key", 2, "existing", **options)).to eq(3.0) - end - - it "should increment only existing elements" do -- expect(@client.zadd("key", 1, "new", options)).to be_nil -+ expect(@client.zadd("key", 1, "new", **options)).to be_nil - end - end - end diff -Nru ruby-fakeredis-0.8.0/debian/patches/del_no_param_no_error.patch ruby-fakeredis-0.8.0/debian/patches/del_no_param_no_error.patch --- ruby-fakeredis-0.8.0/debian/patches/del_no_param_no_error.patch 1970-01-01 00:00:00.000000000 +0000 +++ ruby-fakeredis-0.8.0/debian/patches/del_no_param_no_error.patch 2022-04-04 22:01:54.000000000 +0000 @@ -0,0 +1,18 @@ +Description: skip failing test because of missing trown error + the :del command without parameter is supposed to raise a Redis::CommandError + but no error is raised +Author: Cédric Boutillier +Last-Update: 2022-03-27 +Forwarded: no +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1002985 +--- a/spec/keys_spec.rb ++++ b/spec/keys_spec.rb +@@ -33,7 +33,7 @@ + it "should error '#{command}'ing no keys" do + expect { @client.public_send(command) }.to raise_error(Redis::CommandError, "ERR wrong number of arguments for '#{command}' command") + expect { @client.public_send(command, []) }.to raise_error(Redis::CommandError, "ERR wrong number of arguments for '#{command}' command") +- end ++ end unless command == :del + end + + it "should return true when setnx keys that don't exist" do diff -Nru ruby-fakeredis-0.8.0/debian/patches/exists-command-must-return-int.patch ruby-fakeredis-0.8.0/debian/patches/exists-command-must-return-int.patch --- ruby-fakeredis-0.8.0/debian/patches/exists-command-must-return-int.patch 2021-11-15 11:10:57.000000000 +0000 +++ ruby-fakeredis-0.8.0/debian/patches/exists-command-must-return-int.patch 2022-04-04 22:01:54.000000000 +0000 @@ -2,7 +2,10 @@ From: artygus Date: Fri, 12 Jun 2020 12:50:23 +0300 Subject: [PATCH] exists command must return int +Description: patch upstream + test modifications Origin: https://github.com/guilleiguaran/fakeredis/commit/f68bd4f8d2b87c6445b9166447c1752c6236d63b +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1002985 + --- a/lib/redis/connection/memory.rb +++ b/lib/redis/connection/memory.rb @@ -82,6 +85,31 @@ --- a/spec/hashes_spec.rb +++ b/spec/hashes_spec.rb +@@ -32,7 +32,7 @@ + expect(@client.hdel("key1", "k1")).to be(1) + expect(@client.hdel("key1", "k2")).to be(1) + +- expect(@client.exists("key1")).to eq(false) ++ expect(@client.exists("key1")).to eq(0) + end + + it "should convert key to a string for hset" do +@@ -135,13 +135,13 @@ + + it "should reject an empty list of values" do + expect { @client.hmset("key") }.to raise_error(Redis::CommandError) +- expect(@client.exists("key")).to be false ++ expect(@client.exists("key")).to be 0 + end + + it "rejects an insert with a key but no value" do + expect { @client.hmset("key", 'foo') }.to raise_error(Redis::CommandError) + expect { @client.hmset("key", 'foo', 3, 'bar') }.to raise_error(Redis::CommandError) +- expect(@client.exists("key")).to be false ++ expect(@client.exists("key")).to be 0 + end + + it "should reject the wrong number of arguments" do @@ -167,8 +167,8 @@ end @@ -104,3 +132,116 @@ end end +--- a/spec/keys_spec.rb ++++ b/spec/keys_spec.rb +@@ -66,8 +66,8 @@ + it "should determine if a key exists" do + @client.set("key1", "1") + +- expect(@client.exists("key1")).to eq(true) +- expect(@client.exists("key2")).to eq(false) ++ expect(@client.exists("key1")).to eq(1) ++ expect(@client.exists("key2")).to eq(0) + end + + it "should set a key's time to live in seconds" do +@@ -134,7 +134,7 @@ + @client.set("key1", "1") + @client.expireat("key1", Time.now.to_i) + +- expect(@client.exists("key1")).to be false ++ expect(@client.exists("key1")).to be 0 + end + + it "should get integer and string keys" do +@@ -409,7 +409,7 @@ + + describe "#dump" do + it "returns nil for unknown key" do +- expect(@client.exists("key1")).to be false ++ expect(@client.exists("key1")).to be 0 + expect(@client.dump("key1")).to be nil + end + +@@ -445,7 +445,7 @@ + @dumped_value = @client.dump("key1") + + @client.del("key1") +- expect(@client.exists("key1")).to be false ++ expect(@client.exists("key1")).to be 0 + end + + it "restores to a new key successfully" do +--- a/spec/sets_spec.rb ++++ b/spec/sets_spec.rb +@@ -188,7 +188,7 @@ + @client.srem("key1", "b") + @client.srem("key1", "a") + +- expect(@client.exists("key1")).to eq(false) ++ expect(@client.exists("key1")).to eq(0) + end + + it "should add multiple sets" do +--- a/spec/lists_spec.rb ++++ b/spec/lists_spec.rb +@@ -119,7 +119,7 @@ + end + + it "should return 0 if key does not map to a list" do +- expect(@client.exists("nonexistant")).to eq(false) ++ expect(@client.exists("nonexistant")).to eq(0) + expect(@client.lrem("nonexistant", 0, "value")).to eq(0) + end + +@@ -129,7 +129,7 @@ + @client.lrem("key1", 1, "v1") + @client.lrem("key1", 1, "v2") + +- expect(@client.exists("key1")).to eq(false) ++ expect(@client.exists("key1")).to eq(0) + end + + it "should set the value of an element in a list by its index" do +--- a/spec/server_spec.rb ++++ b/spec/server_spec.rb +@@ -45,13 +45,13 @@ + + @client.select(0) + expect(@client.dbsize).to eq(2) +- expect(@client.exists("key1")).to be true +- expect(@client.exists("key3")).to be false ++ expect(@client.exists("key1")).to be 1 ++ expect(@client.exists("key3")).to be 0 + + @client.select(1) + expect(@client.dbsize).to eq(3) +- expect(@client.exists("key4")).to be true +- expect(@client.exists("key2")).to be false ++ expect(@client.exists("key4")).to be 1 ++ expect(@client.exists("key2")).to be 0 + + @client.flushall + expect(@client.dbsize).to eq(0) +--- a/spec/sorted_sets_spec.rb ++++ b/spec/sorted_sets_spec.rb +@@ -100,7 +100,7 @@ + it "should remove sorted set's key when it is empty" do + @client.zadd("key", 1, "val") + @client.zrem("key", "val") +- expect(@client.exists("key")).to eq(false) ++ expect(@client.exists("key")).to eq(0) + end + + it "should pop members with the highest scores from sorted set" do +--- a/spec/support/shared_examples/bitwise_operation.rb ++++ b/spec/support/shared_examples/bitwise_operation.rb +@@ -5,7 +5,7 @@ + + it "should not create destination key if nothing found" do + expect(@client.bitop(operator, "dest1", "nothing_here1")).to eq(0) +- expect(@client.exists("dest1")).to eq(false) ++ expect(@client.exists("dest1")).to eq(0) + end + + it "should accept operator as a case-insensitive symbol" do diff -Nru ruby-fakeredis-0.8.0/debian/patches/series ruby-fakeredis-0.8.0/debian/patches/series --- ruby-fakeredis-0.8.0/debian/patches/series 2021-11-15 11:10:57.000000000 +0000 +++ ruby-fakeredis-0.8.0/debian/patches/series 2022-04-04 22:01:54.000000000 +0000 @@ -1,2 +1,3 @@ -exists-command-must-return-int.patch Fix_tests_for_Ruby_2.7+_compatibility.patch +exists-command-must-return-int.patch +del_no_param_no_error.patch