Sha256: 18c933cf62364616784d9b50249155ded326e0a299d31b4a731c39a53c1ebf13

Contents?: true

Size: 618 Bytes

Versions: 33

Compression:

Stored size: 618 Bytes

Contents

require 'spec_helper'

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

  it 'returns the new length of the string' do
    @redises.set(@key, 'porkchop')
    @redises.append(@key, 'sandwiches').should == 18
  end

  it 'appends value to the previously-stored value' do
    @redises.set(@key, 'porkchop')
    @redises.append(@key, 'sandwiches')

    @redises.get(@key).should == 'porkchopsandwiches'
  end

  it 'treats a missing key as an empty string' do
    @redises.append(@key, 'foo')
    @redises.get(@key).should == 'foo'
  end

  it_should_behave_like 'a string-only command'
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
mock_redis-0.36.0 spec/commands/append_spec.rb
mock_redis-0.35.0 spec/commands/append_spec.rb
mock_redis-0.34.0 spec/commands/append_spec.rb
mock_redis-0.33.0 spec/commands/append_spec.rb
mock_redis-0.32.0 spec/commands/append_spec.rb
mock_redis-0.31.0 spec/commands/append_spec.rb
mock_redis-0.30.0 spec/commands/append_spec.rb
mock_redis-0.29.0 spec/commands/append_spec.rb
mock_redis-0.28.0 spec/commands/append_spec.rb
mock_redis-0.27.3 spec/commands/append_spec.rb
mock_redis-0.27.2 spec/commands/append_spec.rb
mock_redis-0.27.1 spec/commands/append_spec.rb
mock_redis-0.27.0 spec/commands/append_spec.rb
mock_redis-0.26.0 spec/commands/append_spec.rb
mock_redis-0.25.0 spec/commands/append_spec.rb
mock_redis-0.24.0 spec/commands/append_spec.rb
mock_redis-0.23.0 spec/commands/append_spec.rb
mock_redis-0.22.0 spec/commands/append_spec.rb
mock_redis-0.21.0 spec/commands/append_spec.rb
mock_redis-0.20.0 spec/commands/append_spec.rb