Skip to content

Commit 478c404

Browse files
committed
Merge branch 'no-deep-dup' of https://github.com/byroot/redis-rb into 4.0
2 parents ba9a265 + 3f966c9 commit 478c404

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

lib/redis/client.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ class Client
2121
:inherit_socket => false
2222
}
2323

24-
def options
25-
Marshal.load(Marshal.dump(@options))
26-
end
24+
attr_reader :options
2725

2826
def scheme
2927
@options[:scheme]

test/internals_test.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -354,19 +354,6 @@ def test_client_options
354354
assert_equal "foo", redis._client.options[:scheme]
355355
end
356356

357-
def test_does_not_change_self_client_options
358-
redis = Redis.new(OPTIONS.merge(:host => "host", :port => 1234, :db => 1, :scheme => "foo"))
359-
options = redis._client.options
360-
361-
options[:host] << "new_host"
362-
options[:scheme] << "bar"
363-
options.merge!(:db => 0)
364-
365-
assert_equal "host", redis._client.options[:host]
366-
assert_equal 1, redis._client.options[:db]
367-
assert_equal "foo", redis._client.options[:scheme]
368-
end
369-
370357
def test_resolves_localhost
371358
assert_nothing_raised do
372359
Redis.new(OPTIONS.merge(:host => 'localhost')).ping

0 commit comments

Comments
 (0)