module MockRedis::Error
Public Instance Methods
Source
# File lib/mock_redis/error.rb, line 5 def build(error_class, message, database) connection = database.connection url = "redis://#{connection[:host]}:#{connection[:port]}" error_class.new("#{message} (#{url})") end
Source
# File lib/mock_redis/error.rb, line 23 def command_error(message, database) build(Redis::CommandError, message, database) end
Source
# File lib/mock_redis/error.rb, line 19 def syntax_error(database) command_error('ERR syntax error', database) end
Source
# File lib/mock_redis/error.rb, line 11 def wrong_type_error(database) build( Redis::WrongTypeError, 'WRONGTYPE Operation against a key holding the wrong kind of value', database ) end