We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61bb68f commit e4cf767Copy full SHA for e4cf767
lib/redis.rb
@@ -627,7 +627,7 @@ def incrbyfloat(key, increment)
627
# @return `"OK"`
628
def set(key, value)
629
synchronize do |client|
630
- client.call([:set, key, value])
+ client.call([:set, key, value.to_s])
631
end
632
633
test/lint/strings.rb
@@ -26,6 +26,14 @@ def test_set_and_get_with_newline_characters
26
assert_equal "1\n", r.get("foo")
27
28
29
+ def test_set_and_get_with_non_string_value
30
+ value = ["a", "b"]
31
+
32
+ r.set("foo", value)
33
34
+ assert_equal value.to_s, r.get("foo")
35
+ end
36
37
def test_set_and_get_with_ascii_characters
38
if defined?(Encoding)
39
with_external_encoding("ASCII-8BIT") do
0 commit comments