+
+ it "should be able to handle array of :get using SORT" do
+ @r['dog:1:name'] = 'louie'
+ @r['dog:1:breed'] = 'mutt'
+ @r.push_tail 'dogs', 1
+ @r['dog:2:name'] = 'lucy'
+ @r['dog:2:breed'] = 'poodle'
+ @r.push_tail 'dogs', 2
+ @r['dog:3:name'] = 'max'
+ @r['dog:3:breed'] = 'hound'
+ @r.push_tail 'dogs', 3
+ @r['dog:4:name'] = 'taj'
+ @r['dog:4:breed'] = 'terrier'
+ @r.push_tail 'dogs', 4
+ @r.sort('dogs', :get => ['dog:*:name', 'dog:*:breed'], :limit => [0,1]).should == ['louie', 'mutt']
+ @r.sort('dogs', :get => ['dog:*:name', 'dog:*:breed'], :limit => [0,1], :order => 'desc alpha').should == ['taj', 'terrier']
+ end
+ #
+ it "should provide info" do
+ [:last_save_time, :redis_version, :total_connections_received, :connected_clients, :total_commands_processed, :connected_slaves, :uptime_in_seconds, :used_memory, :uptime_in_days, :changes_since_last_save].each do |x|
+ @r.info.keys.should include(x)
+ end
+ end
+ #
+ it "should be able to flush the database" do
+ @r['key1'] = 'keyone'
+ @r['key2'] = 'keytwo'
+ @r.keys('*').sort.should == ['foo', 'key1', 'key2'] #foo from before
+ @r.flush_db
+ @r.keys('*').should == []
+ end
+ #
+ it "should be able to provide the last save time" do
+ savetime = @r.last_save
+ Time.at(savetime).class.should == Time
+ Time.at(savetime).should <= Time.now
+ end
+
+ it "should be able to MGET keys" do
+ @r['foo'] = 1000
+ @r['bar'] = 2000
+ @r.mget('foo', 'bar').should == ['1000', '2000']
+ @r.mget('foo', 'bar', 'baz').should == ['1000', '2000', nil]
+ end
+
+ it "should bgsave" do
+ lambda {@r.bgsave}.should_not raise_error(RedisError)
+ end
+
+ it "should handle multiple servers" do
+ require 'dist_redis'
+ @r = DistRedis.new('localhost:6379', '127.0.0.1:6379')
+ @r.select_db(15) # use database 15 for testing so we dont accidentally step on you real data
+
+ 100.times do |idx|
+ @r[idx] = "foo#{idx}"
+ end
+
+ 100.times do |idx|
+ @r[idx].should == "foo#{idx}"
+ end
+ end
+
+ it "should be able to pipeline writes" do
+ @r.pipelined do |pipeline|
+ pipeline.push_head "list", "hello"
+ pipeline.push_head "list", 42
+ end
+
+ @r.type?('list').should == "list"
+ @r.list_length('list').should == 2
+ @r.pop_head('list').should == '42'
+ @r.delete('list')
+ end
+
+ it "should select db on connection"
+ it "should re-select db on reconnection"
+end