Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Missed a MASSIVE set of failures in the sadd spec the first time

arround. This corrals the dump call to arrays hashes and strings
  • Loading branch information...
commit 15d8f446926b7cd58487063fde95222aec51bd6f 1 parent c19d634
@kungfumike authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/mock_redis/utility_methods.rb
View
6 lib/mock_redis/utility_methods.rb
@@ -9,12 +9,16 @@ def with_thing_at(key, assertion, empty_thing_generator)
data_key_ref = data[key]
ret = yield data[key]
data[key] = data_key_ref if data[key].nil?
- ret ? ret.dup : ret
+ primitive?(ret) ? ret.dup : ret
ensure
clean_up_empties_at(key)
end
end
+ def primitive?(value)
+ value.kind_of?(::Array) || value.kind_of?(::Hash) ||value.kind_of?(::String)
+ end
+
def clean_up_empties_at(key)
if data[key] && data[key].empty?
del(key)
Please sign in to comment.
Something went wrong with that request. Please try again.