diff --git a/lib/mock_redis/zset_methods.rb b/lib/mock_redis/zset_methods.rb index c4033968..3b8c4fba 100644 --- a/lib/mock_redis/zset_methods.rb +++ b/lib/mock_redis/zset_methods.rb @@ -26,7 +26,7 @@ def zadd(key, *args) end def zadd_one_member(key, score, member, zadd_options = {}) - assert_scorey(score) unless score =~ /(\+|\-)inf/ + assert_scorey(score) unless score.to_s =~ /(\+|\-)inf/ with_zset_at(key) do |zset| if zadd_options[:incr] @@ -326,7 +326,7 @@ def looks_like_float?(x) end def assert_scorey(value, message = 'ERR value is not a valid float') - return if value =~ /\(?(\-|\+)inf/ + return if value.to_s =~ /\(?(\-|\+)inf/ value = $1 if value.to_s =~ /\((.*)/ unless looks_like_float?(value)