Sha256: 2cd91ebba98bdf72e749f87b757f415960c8acc9aee3175dcd09d9087c1a3e12

Contents?: true

Size: 1.72 KB

Versions: 10

Compression:

Stored size: 1.72 KB

Contents

shared_examples_for "Map CRDT" do
  let(:typed_collection){ Riak::Crdt::TypedCollection }

  it 'contains counters' do
    expect(subject).to respond_to(:counters)
    expect(subject.counters).to be_an_instance_of typed_collection
  end

  it 'contains flags' do
    expect(subject).to respond_to(:flags)
    expect(subject.counters).to be_an_instance_of typed_collection
  end

  it 'contains maps' do
    expect(subject).to respond_to(:maps)
    expect(subject.counters).to be_an_instance_of typed_collection
  end

  it 'contains registers' do
    expect(subject).to respond_to(:registers)
    expect(subject.counters).to be_an_instance_of typed_collection
  end

  it 'contains sets' do
    expect(subject).to respond_to(:sets)
    expect(subject.counters).to be_an_instance_of typed_collection
  end

  it 'accepts operations' do
    expect(subject).to respond_to(:operate)
  end
end

shared_examples_for "Counter CRDT" do
  it 'has a value' do
    expect(subject).to respond_to :value
  end

  it 'has an increment method' do
    expect(subject).to respond_to :increment
  end

  it 'has a decrement method' do
    expect(subject).to respond_to :decrement
  end

  it 'has a batch method' do
    expect(subject).to respond_to :batch
  end
end

shared_examples_for 'Set CRDT' do
  it 'has a value' do
    expect(subject).to respond_to :value
    expect(subject).to respond_to :members
    expect(subject).to respond_to :to_a
  end

  it 'has an include? method' do
    expect(subject).to respond_to :include?
  end

  it 'has an empty? method' do
    expect(subject).to respond_to :empty?
  end

  it 'has an add method' do
    expect(subject).to respond_to :add
  end

  it 'has a remove method' do
    expect(subject).to respond_to :remove
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
riak-client-2.4.1 spec/riak/crdt/shared_examples.rb
riak-client-2.4.0 spec/riak/crdt/shared_examples.rb
riak-client-2.4.0.pre1 spec/riak/crdt/shared_examples.rb
riak-client-2.3.2 spec/riak/crdt/shared_examples.rb
riak-client-2.3.1 spec/riak/crdt/shared_examples.rb
riak-client-2.3.0 spec/riak/crdt/shared_examples.rb
riak-client-2.2.2 spec/riak/crdt/shared_examples.rb
riak-client-2.2.1 spec/riak/crdt/shared_examples.rb
riak-client-noenc-1.0.0 spec/riak/crdt/shared_examples.rb
riak-client-2.2.0 spec/riak/crdt/shared_examples.rb