Sha256: 8115ba6169d8317931c1bf5af4969782ff5135387303b9ad72767c552310b879

Contents?: true

Size: 788 Bytes

Versions: 3

Compression:

Stored size: 788 Bytes

Contents

require 'spec_helper'
require_relative 'shared_examples'

describe Riak::Crdt::InnerSet do
  let(:parent){ double 'parent' }
  let(:set_name){ 'set name' }
  subject do
    described_class.new(parent, []).tap do |s|
      s.name = set_name
    end
  end

  include_examples 'Set CRDT'

  it 'should send additions to the parent' do
    expect(parent).to receive(:operate) do |name, op|
      expect(name).to eq set_name
      expect(op.type).to eq :set
      expect(op.value).to eq add: 'el'
    end

    subject.add 'el'

    expect(parent).to receive(:operate) do |name, op|
      expect(name).to eq set_name
      expect(op.type).to eq :set
      expect(op.value).to eq remove: 'el2'
    end
    allow(parent).to receive(:context?).and_return(true)

    subject.remove 'el2'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
riak-client-2.0.0 spec/riak/crdt/inner_set_spec.rb
riak-client-2.0.0.rc2 spec/riak/crdt/inner_set_spec.rb
riak-client-2.0.0.rc1 spec/riak/crdt/inner_set_spec.rb