Sha256: 2050c570932120336964b0e8bec6db72744339862c252be8c7941b35fd4aeb8e

Contents?: true

Size: 527 Bytes

Versions: 10

Compression:

Stored size: 527 Bytes

Contents

require 'spec_helper'

describe MockRedis::Future do
  let(:command) { [:get, 'foo'] }
  let(:result)  { 'bar' }
  before        { @future = MockRedis::Future.new(command) }

  it 'remembers the command' do
    @future.command.should eq(command)
  end

  it 'raises an error if the value is requested before the result is set' do
    expect{@future.value}.to raise_error(RuntimeError)
  end

  it 'returns the value after the result has been set' do
    @future.set_result(result)
    @future.value.should eq(result)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mock_redis-0.14.1 spec/commands/future_spec.rb
mock_redis-0.14.0 spec/commands/future_spec.rb
mock_redis-0.13.2 spec/commands/future_spec.rb
mock_redis-0.13.1 spec/commands/future_spec.rb
mock_redis-0.13.0 spec/commands/future_spec.rb
mock_redis-0.12.1 spec/commands/future_spec.rb
mock_redis-0.12.0 spec/commands/future_spec.rb
mock_redis-0.11.0 spec/commands/future_spec.rb
mock_redis-0.10.0 spec/commands/future_spec.rb
mock_redis-0.9.0 spec/commands/future_spec.rb