Sha256: f6fc9d9dd8cfb4a2b24fb568d0b2c7ad486a931a0eeae6b2cb837487e8ac8a69

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

require 'spec_helper'

describe SSDB::Future do

  subject do
    described_class.new ["set", "key", "val"]
  end

  it { should be_instance_of(described_class) }

  it "should be introspectable" do
    subject.inspect.should == %(<SSDB::Future ["set", "key", "val"]>)
  end

  it "should raise error when not ready" do
    -> { subject.value }.should raise_error(SSDB::FutureNotReady)
  end

  it "should return value when ready" do
    subject.value = "ok"
    subject.value.should == "ok"

    subject.value = true
    subject.value.should == true

    subject.value = nil
    subject.value.should == nil
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ssdb-0.1.0 spec/ssdb/future_spec.rb