Sha256: 84be3240883b01274f05e890e460405c17fd9b857fbf09784a6f711d1621d24c

Contents?: true

Size: 782 Bytes

Versions: 8

Compression:

Stored size: 782 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 'sends 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

8 entries across 8 versions & 2 rubygems

Version Path
riak-client-2.5.0 spec/riak/crdt/inner_set_spec.rb
riak-client-2.3.0 spec/riak/crdt/inner_set_spec.rb
riak-client-2.2.2 spec/riak/crdt/inner_set_spec.rb
riak-client-2.2.1 spec/riak/crdt/inner_set_spec.rb
riak-client-noenc-1.0.0 spec/riak/crdt/inner_set_spec.rb
riak-client-2.2.0 spec/riak/crdt/inner_set_spec.rb
riak-client-2.2.0.pre1 spec/riak/crdt/inner_set_spec.rb
riak-client-2.1.0 spec/riak/crdt/inner_set_spec.rb