redis 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +9 -8
  3. data/.travis.yml +10 -8
  4. data/CHANGELOG.md +4 -0
  5. data/Rakefile +21 -10
  6. data/lib/redis.rb +229 -72
  7. data/lib/redis/version.rb +1 -1
  8. data/test/blocking_commands_test.rb +1 -1
  9. data/test/command_map_test.rb +1 -1
  10. data/test/commands_on_hashes_test.rb +1 -1
  11. data/test/commands_on_lists_test.rb +1 -1
  12. data/test/commands_on_sets_test.rb +1 -1
  13. data/test/commands_on_sorted_sets_test.rb +1 -1
  14. data/test/commands_on_strings_test.rb +14 -14
  15. data/test/commands_on_value_types_test.rb +1 -1
  16. data/test/connection_handling_test.rb +1 -1
  17. data/test/distributed_blocking_commands_test.rb +1 -1
  18. data/test/distributed_commands_on_hashes_test.rb +1 -1
  19. data/test/distributed_commands_on_lists_test.rb +1 -1
  20. data/test/distributed_commands_on_sets_test.rb +1 -1
  21. data/test/distributed_commands_on_sorted_sets_test.rb +1 -1
  22. data/test/distributed_commands_on_strings_test.rb +7 -7
  23. data/test/distributed_commands_on_value_types_test.rb +1 -1
  24. data/test/distributed_commands_requiring_clustering_test.rb +14 -14
  25. data/test/distributed_connection_handling_test.rb +1 -1
  26. data/test/distributed_internals_test.rb +1 -1
  27. data/test/distributed_key_tags_test.rb +1 -1
  28. data/test/distributed_persistence_control_commands_test.rb +1 -1
  29. data/test/distributed_publish_subscribe_test.rb +1 -1
  30. data/test/distributed_remote_server_control_commands_test.rb +15 -15
  31. data/test/distributed_scripting_test.rb +57 -57
  32. data/test/distributed_sorting_test.rb +1 -1
  33. data/test/distributed_test.rb +1 -1
  34. data/test/distributed_transactions_test.rb +1 -1
  35. data/test/encoding_test.rb +1 -1
  36. data/test/error_replies_test.rb +1 -1
  37. data/test/helper.rb +10 -1
  38. data/test/helper_test.rb +1 -1
  39. data/test/internals_test.rb +20 -9
  40. data/test/lint/hashes.rb +17 -17
  41. data/test/lint/lists.rb +10 -10
  42. data/test/lint/sets.rb +14 -14
  43. data/test/lint/sorted_sets.rb +30 -30
  44. data/test/lint/strings.rb +45 -45
  45. data/test/lint/value_types.rb +32 -32
  46. data/test/persistence_control_commands_test.rb +1 -1
  47. data/test/pipelining_commands_test.rb +1 -1
  48. data/test/publish_subscribe_test.rb +1 -1
  49. data/test/remote_server_control_commands_test.rb +7 -7
  50. data/test/scanning_test.rb +413 -0
  51. data/test/scripting_test.rb +45 -45
  52. data/test/sorting_test.rb +1 -1
  53. data/test/thread_safety_test.rb +1 -1
  54. data/test/transactions_test.rb +1 -1
  55. data/test/unknown_commands_test.rb +1 -1
  56. data/test/url_param_test.rb +1 -1
  57. metadata +6 -4
  58. data/test/db/.gitignore +0 -1
@@ -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
- return if version < "2.5.9" # 2.6-rc1
15
-
16
- a = to_sha("return 1")
17
- b = a.succ
18
-
19
- assert_equal true, r.script(:exists, a)
20
- assert_equal false, r.script(:exists, b)
21
- assert_equal [true], r.script(:exists, [a])
22
- assert_equal [false], r.script(:exists, [b])
23
- assert_equal [true, false], r.script(:exists, [a, b])
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
- return if version < "2.5.9" # 2.6-rc1
28
-
29
- sha = to_sha("return 1")
30
- assert r.script(:exists, sha)
31
- assert_equal "OK", r.script(:flush)
32
- assert !r.script(:exists, sha)
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
- return if version < "2.5.9" # 2.6-rc1
37
-
38
- redis_mock(:script => lambda { |arg| "+#{arg.upcase}" }) do |redis|
39
- assert_equal "KILL", redis.script(:kill)
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
- return if version < "2.5.9" # 2.6-rc1
45
-
46
- assert_equal 0, r.eval("return #KEYS")
47
- assert_equal 0, r.eval("return #ARGV")
48
- assert_equal ["k1", "k2"], r.eval("return KEYS", ["k1", "k2"])
49
- assert_equal ["a1", "a2"], r.eval("return ARGV", [], ["a1", "a2"])
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
- return if version < "2.5.9" # 2.6-rc1
54
-
55
- assert_equal 0, r.eval("return #KEYS", {})
56
- assert_equal 0, r.eval("return #ARGV", {})
57
- assert_equal ["k1", "k2"], r.eval("return KEYS", { :keys => ["k1", "k2"] })
58
- assert_equal ["a1", "a2"], r.eval("return ARGV", { :argv => ["a1", "a2"] })
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
- return if version < "2.5.9" # 2.6-rc1
63
-
64
- assert_equal 0, r.evalsha(to_sha("return #KEYS"))
65
- assert_equal 0, r.evalsha(to_sha("return #ARGV"))
66
- assert_equal ["k1", "k2"], r.evalsha(to_sha("return KEYS"), ["k1", "k2"])
67
- assert_equal ["a1", "a2"], r.evalsha(to_sha("return ARGV"), [], ["a1", "a2"])
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
- return if version < "2.5.9" # 2.6-rc1
72
-
73
- assert_equal 0, r.evalsha(to_sha("return #KEYS"), {})
74
- assert_equal 0, r.evalsha(to_sha("return #ARGV"), {})
75
- assert_equal ["k1", "k2"], r.evalsha(to_sha("return KEYS"), { :keys => ["k1", "k2"] })
76
- assert_equal ["a1", "a2"], r.evalsha(to_sha("return ARGV"), { :argv => ["a1", "a2"] })
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
@@ -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 TestSorting < Test::Unit::TestCase
6
6
 
@@ -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 TestThreadSafety < Test::Unit::TestCase
6
6
 
@@ -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 TestTransactions < Test::Unit::TestCase
6
6
 
@@ -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 TestUnknownCommands < Test::Unit::TestCase
6
6
 
@@ -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 TestUrlParam < Test::Unit::TestCase
6
6
 
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.5
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-10-02 00:00:00.000000000 Z
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/.gitignore
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/.gitignore
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
@@ -1 +0,0 @@
1
- redis.pid