-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
417 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class MockRedis | ||
module Error | ||
module_function | ||
|
||
def build(error_class, message, database) | ||
connection = database.connection | ||
url = "redis://#{connection[:host]}:#{connection[:port]}" | ||
error_class.new("#{message} (#{url})") | ||
end | ||
|
||
def wrong_type_error(database) | ||
build( | ||
Redis::WrongTypeError, | ||
'WRONGTYPE Operation against a key holding the wrong kind of value', | ||
database | ||
) | ||
end | ||
|
||
def syntax_error(database) | ||
command_error('ERR syntax error', database) | ||
end | ||
|
||
def command_error(message, database) | ||
build(Redis::CommandError, message, database) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.