Sha256: 33d3af479c8f9e750df2442e7b96646990541210996eef91bd3a5a5a25e0c39d

Contents?: true

Size: 516 Bytes

Versions: 39

Compression:

Stored size: 516 Bytes

Contents

require 'spec_helper'

describe '#setex(key, seconds, value)' do
  before { @key = 'mock-redis-test:setex' }

  it "responds with 'OK'" do
    @redises.setex(@key, 10, 'value').should == 'OK'
  end

  it "sets the value" do
    @redises.setex(@key, 10000, 'value')
    @redises.get(@key).should == 'value'
  end

  it "sets the expiration time" do
    @redises.setex(@key, 10000, 'value')

    # no guarantee these are the same
    @redises.real.ttl(@key).should > 0
    @redises.mock.ttl(@key).should > 0
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
mock_redis-0.14.1 spec/commands/setex_spec.rb
mock_redis-0.14.0 spec/commands/setex_spec.rb
mock_redis-0.13.2 spec/commands/setex_spec.rb
mock_redis-0.13.1 spec/commands/setex_spec.rb
mock_redis-0.13.0 spec/commands/setex_spec.rb
mock_redis-0.12.1 spec/commands/setex_spec.rb
mock_redis-0.12.0 spec/commands/setex_spec.rb
mock_redis-0.11.0 spec/commands/setex_spec.rb
mock_redis-0.10.0 spec/commands/setex_spec.rb
mock_redis-0.9.0 spec/commands/setex_spec.rb
mock_redis-0.8.2 spec/commands/setex_spec.rb
mock_redis-0.8.1 spec/commands/setex_spec.rb
mock_redis-0.8.0 spec/commands/setex_spec.rb
mock_redis-0.7.0 spec/commands/setex_spec.rb
mock_redis-0.6.6 spec/commands/setex_spec.rb
mock_redis-0.6.5 spec/commands/setex_spec.rb
mock_redis-0.6.4 spec/commands/setex_spec.rb
mock_redis-0.6.3 spec/commands/setex_spec.rb
mock_redis-0.6.2 spec/commands/setex_spec.rb
mock_redis-0.6.1 spec/commands/setex_spec.rb