Sha256: d153cf74b4386b6064cd0de93e98732cb8da14302d618b9d86564c2f6d1e89d2

Contents?: true

Size: 815 Bytes

Versions: 5

Compression:

Stored size: 815 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

5 entries across 5 versions & 1 rubygems

Version Path
riak-client-2.4.1 spec/riak/crdt/inner_set_spec.rb
riak-client-2.4.0 spec/riak/crdt/inner_set_spec.rb
riak-client-2.4.0.pre1 spec/riak/crdt/inner_set_spec.rb
riak-client-2.3.2 spec/riak/crdt/inner_set_spec.rb
riak-client-2.3.1 spec/riak/crdt/inner_set_spec.rb