Sha256: 0aa093f8b390abb23e1952a12f670513220718529e92ac6a2ec2fac419a553a8

Contents?: true

Size: 719 Bytes

Versions: 2

Compression:

Stored size: 719 Bytes

Contents

test "Logger" do |r, log|
  r.ping

  assert log.string =~ /Redis >> PING/
  assert log.string =~ /Redis >> \d+\.\d+ms/
end

test "Logger with pipelining" do |r, log|
  r.pipelined do
    r.set "foo", "bar"
    r.get "foo"
  end

  assert log.string["SET foo bar"]
  assert log.string["GET foo"]
end if $TEST_PIPELINING

test "Recovers from failed commands" do |r, _|
  # See http://github.com/ezmobius/redis-rb/issues#issue/28

  assert_raise do
    r.command_that_doesnt_exist
  end

  assert_nothing_raised do
    r.info
  end
end

test "raises on protocol errors" do
  redis_mock(:ping => lambda { |*_| "foo" }) do
    assert_raise(Redis::ProtocolError) do
      Redis.connect(:port => 6380).ping
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
gorsuch-redis-3.0.0.rc1 test/lint/internals.rb
redis-3.0.0.rc1 test/lint/internals.rb