Sha256: 87693fdf6d00b3475b0ba4ca99f7f3d92f96760f1a46d59bf994975b5b3a6af4

Contents?: true

Size: 556 Bytes

Versions: 2

Compression:

Stored size: 556 Bytes

Contents

require 'spec_helper'

describe '#getdel(key)' do
  before do
    @key = 'mock-redis-test:73288'
  end

  it 'returns nil for a nonexistent value' do
    @redises.getdel('mock-redis-test:does-not-exist').should be_nil
  end

  it 'returns a stored string value' do
    @redises.set(@key, 'forsooth')
    @redises.getdel(@key).should == 'forsooth'
  end

  it 'deletes the key after returning it' do
    @redises.set(@key, 'forsooth')
    @redises.getdel(@key)
    @redises.get(@key).should be_nil
  end

  it_should_behave_like 'a string-only command'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mock_redis-0.36.0 spec/commands/getdel.rb
mock_redis-0.35.0 spec/commands/getdel.rb