Sha256: 40a982615e51fc321356a1948ae6c083aa231e556e5e28efe3b40713f8b582d5

Contents?: true

Size: 690 Bytes

Versions: 1

Compression:

Stored size: 690 Bytes

Contents

require 'spec_helper'

describe '#mset(key, value [, key, value, ...])' do
  before do
    @key1 = 'mock-redis-test:mset1'
    @key2 = 'mock-redis-test:mset2'
  end

  it "responds with 'OK'" do
    @redises.mset(@key1, 1).should == 'OK'
  end

  it 'sets the values' do
    @redises.mset(@key1, 'value1', @key2, 'value2')
    @redises.mget(@key1, @key2).should == %w[value1 value2]
  end

  it 'raises an error if given an odd number of arguments' do
    lambda do
      @redises.mset(@key1, 'value1', @key2)
    end.should raise_error(RuntimeError)
  end

  it 'raises an error if given 0 arguments' do
    lambda do
      @redises.mset
    end.should raise_error(RuntimeError)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mock_redis-0.15.0 spec/commands/mset_spec.rb