redis 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.gitignore +9 -8
- data/.travis.yml +10 -8
- data/CHANGELOG.md +4 -0
- data/Rakefile +21 -10
- data/lib/redis.rb +229 -72
- data/lib/redis/version.rb +1 -1
- data/test/blocking_commands_test.rb +1 -1
- data/test/command_map_test.rb +1 -1
- data/test/commands_on_hashes_test.rb +1 -1
- data/test/commands_on_lists_test.rb +1 -1
- data/test/commands_on_sets_test.rb +1 -1
- data/test/commands_on_sorted_sets_test.rb +1 -1
- data/test/commands_on_strings_test.rb +14 -14
- data/test/commands_on_value_types_test.rb +1 -1
- data/test/connection_handling_test.rb +1 -1
- data/test/distributed_blocking_commands_test.rb +1 -1
- data/test/distributed_commands_on_hashes_test.rb +1 -1
- data/test/distributed_commands_on_lists_test.rb +1 -1
- data/test/distributed_commands_on_sets_test.rb +1 -1
- data/test/distributed_commands_on_sorted_sets_test.rb +1 -1
- data/test/distributed_commands_on_strings_test.rb +7 -7
- data/test/distributed_commands_on_value_types_test.rb +1 -1
- data/test/distributed_commands_requiring_clustering_test.rb +14 -14
- data/test/distributed_connection_handling_test.rb +1 -1
- data/test/distributed_internals_test.rb +1 -1
- data/test/distributed_key_tags_test.rb +1 -1
- data/test/distributed_persistence_control_commands_test.rb +1 -1
- data/test/distributed_publish_subscribe_test.rb +1 -1
- data/test/distributed_remote_server_control_commands_test.rb +15 -15
- data/test/distributed_scripting_test.rb +57 -57
- data/test/distributed_sorting_test.rb +1 -1
- data/test/distributed_test.rb +1 -1
- data/test/distributed_transactions_test.rb +1 -1
- data/test/encoding_test.rb +1 -1
- data/test/error_replies_test.rb +1 -1
- data/test/helper.rb +10 -1
- data/test/helper_test.rb +1 -1
- data/test/internals_test.rb +20 -9
- data/test/lint/hashes.rb +17 -17
- data/test/lint/lists.rb +10 -10
- data/test/lint/sets.rb +14 -14
- data/test/lint/sorted_sets.rb +30 -30
- data/test/lint/strings.rb +45 -45
- data/test/lint/value_types.rb +32 -32
- data/test/persistence_control_commands_test.rb +1 -1
- data/test/pipelining_commands_test.rb +1 -1
- data/test/publish_subscribe_test.rb +1 -1
- data/test/remote_server_control_commands_test.rb +7 -7
- data/test/scanning_test.rb +413 -0
- data/test/scripting_test.rb +45 -45
- data/test/sorting_test.rb +1 -1
- data/test/thread_safety_test.rb +1 -1
- data/test/transactions_test.rb +1 -1
- data/test/unknown_commands_test.rb +1 -1
- data/test/url_param_test.rb +1 -1
- metadata +6 -4
- data/test/db/.gitignore +0 -1
data/test/scripting_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
-
require "helper"
|
3
|
+
require File.expand_path("helper", File.dirname(__FILE__))
|
4
4
|
|
5
5
|
class TestScripting < Test::Unit::TestCase
|
6
6
|
|
@@ -11,68 +11,68 @@ class TestScripting < Test::Unit::TestCase
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_script_exists
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
14
|
+
target_version "2.5.9" do # 2.6-rc1
|
15
|
+
a = to_sha("return 1")
|
16
|
+
b = a.succ
|
17
|
+
|
18
|
+
assert_equal true, r.script(:exists, a)
|
19
|
+
assert_equal false, r.script(:exists, b)
|
20
|
+
assert_equal [true], r.script(:exists, [a])
|
21
|
+
assert_equal [false], r.script(:exists, [b])
|
22
|
+
assert_equal [true, false], r.script(:exists, [a, b])
|
23
|
+
end
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_script_flush
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
target_version "2.5.9" do # 2.6-rc1
|
28
|
+
sha = to_sha("return 1")
|
29
|
+
assert r.script(:exists, sha)
|
30
|
+
assert_equal "OK", r.script(:flush)
|
31
|
+
assert !r.script(:exists, sha)
|
32
|
+
end
|
33
33
|
end
|
34
34
|
|
35
35
|
def test_script_kill
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
target_version "2.5.9" do # 2.6-rc1
|
37
|
+
redis_mock(:script => lambda { |arg| "+#{arg.upcase}" }) do |redis|
|
38
|
+
assert_equal "KILL", redis.script(:kill)
|
39
|
+
end
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_eval
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
target_version "2.5.9" do # 2.6-rc1
|
45
|
+
assert_equal 0, r.eval("return #KEYS")
|
46
|
+
assert_equal 0, r.eval("return #ARGV")
|
47
|
+
assert_equal ["k1", "k2"], r.eval("return KEYS", ["k1", "k2"])
|
48
|
+
assert_equal ["a1", "a2"], r.eval("return ARGV", [], ["a1", "a2"])
|
49
|
+
end
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_eval_with_options_hash
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
target_version "2.5.9" do # 2.6-rc1
|
54
|
+
assert_equal 0, r.eval("return #KEYS", {})
|
55
|
+
assert_equal 0, r.eval("return #ARGV", {})
|
56
|
+
assert_equal ["k1", "k2"], r.eval("return KEYS", { :keys => ["k1", "k2"] })
|
57
|
+
assert_equal ["a1", "a2"], r.eval("return ARGV", { :argv => ["a1", "a2"] })
|
58
|
+
end
|
59
59
|
end
|
60
60
|
|
61
61
|
def test_evalsha
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
62
|
+
target_version "2.5.9" do # 2.6-rc1
|
63
|
+
assert_equal 0, r.evalsha(to_sha("return #KEYS"))
|
64
|
+
assert_equal 0, r.evalsha(to_sha("return #ARGV"))
|
65
|
+
assert_equal ["k1", "k2"], r.evalsha(to_sha("return KEYS"), ["k1", "k2"])
|
66
|
+
assert_equal ["a1", "a2"], r.evalsha(to_sha("return ARGV"), [], ["a1", "a2"])
|
67
|
+
end
|
68
68
|
end
|
69
69
|
|
70
70
|
def test_evalsha_with_options_hash
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
target_version "2.5.9" do # 2.6-rc1
|
72
|
+
assert_equal 0, r.evalsha(to_sha("return #KEYS"), {})
|
73
|
+
assert_equal 0, r.evalsha(to_sha("return #ARGV"), {})
|
74
|
+
assert_equal ["k1", "k2"], r.evalsha(to_sha("return KEYS"), { :keys => ["k1", "k2"] })
|
75
|
+
assert_equal ["a1", "a2"], r.evalsha(to_sha("return ARGV"), { :argv => ["a1", "a2"] })
|
76
|
+
end
|
77
77
|
end
|
78
78
|
end
|
data/test/sorting_test.rb
CHANGED
data/test/thread_safety_test.rb
CHANGED
data/test/transactions_test.rb
CHANGED
data/test/url_param_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2013-
|
19
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rake
|
@@ -87,7 +87,7 @@ files:
|
|
87
87
|
- test/commands_on_strings_test.rb
|
88
88
|
- test/commands_on_value_types_test.rb
|
89
89
|
- test/connection_handling_test.rb
|
90
|
-
- test/db/.
|
90
|
+
- test/db/.gitkeep
|
91
91
|
- test/distributed_blocking_commands_test.rb
|
92
92
|
- test/distributed_commands_on_hashes_test.rb
|
93
93
|
- test/distributed_commands_on_lists_test.rb
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- test/pipelining_commands_test.rb
|
123
123
|
- test/publish_subscribe_test.rb
|
124
124
|
- test/remote_server_control_commands_test.rb
|
125
|
+
- test/scanning_test.rb
|
125
126
|
- test/scripting_test.rb
|
126
127
|
- test/sorting_test.rb
|
127
128
|
- test/support/connection/hiredis.rb
|
@@ -169,7 +170,7 @@ test_files:
|
|
169
170
|
- test/commands_on_strings_test.rb
|
170
171
|
- test/commands_on_value_types_test.rb
|
171
172
|
- test/connection_handling_test.rb
|
172
|
-
- test/db/.
|
173
|
+
- test/db/.gitkeep
|
173
174
|
- test/distributed_blocking_commands_test.rb
|
174
175
|
- test/distributed_commands_on_hashes_test.rb
|
175
176
|
- test/distributed_commands_on_lists_test.rb
|
@@ -204,6 +205,7 @@ test_files:
|
|
204
205
|
- test/pipelining_commands_test.rb
|
205
206
|
- test/publish_subscribe_test.rb
|
206
207
|
- test/remote_server_control_commands_test.rb
|
208
|
+
- test/scanning_test.rb
|
207
209
|
- test/scripting_test.rb
|
208
210
|
- test/sorting_test.rb
|
209
211
|
- test/support/connection/hiredis.rb
|
data/test/db/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
redis.pid
|