causes/mock_redis — pull request #31 by ecoffey (2012-10-22 03:49:04+00:00)
Title: Implement sort command

This is only the start of the implementation. Figured it would be better to show what I had gotten done thus far (which is substantial I think) instead of dropping a giant code bomb.

I implemented the specs as a shared behavior, and right now only sets assert that they are part of that behavior. The idea was that the "sortable" types (sets, lists, sorted sets) would all share the same tests.

I've also punted on ordering by "alpha" vs "non-alpha".

Redis say it treats everything like numbers, but don't know if that means we should force #to_i on the weights if "alpha" is not specified.

Feedback needed and appreciated!