spec/integration/riak/crdt_spec.rb in riak-client-2.0.0.rc1 vs spec/integration/riak/crdt_spec.rb in riak-client-2.0.0.rc2

- old
+ new

@@ -18,15 +18,35 @@ it "should allow override bucket-types for instances" do expect(Riak::Crdt::Set.new(bucket, 'set', 'other_bucket_type').bucket_type).to eq 'other_bucket_type' end end - describe 'an anonymous counter' do - subject { Riak::Crdt::Counter.new bucket, nil } - it 'accepts a Riak-assigned name' do - subject.increment - expect(subject.key).to be - expect(subject.value).to eq 1 + describe 'Riak-assigned names' do + describe 'an anonymous counter' do + subject { Riak::Crdt::Counter.new bucket, nil } + it 'accepts a Riak-assigned name' do + subject.increment + expect(subject.key).to be + expect(subject.value).to eq 1 + end + end + + describe 'an anonymous set' do + subject { Riak::Crdt::Set.new bucket, nil } + it 'accepts a Riak-assigned name' do + subject.add 'sandwich' + expect(subject.key).to be + expect(subject).to include 'sandwich' + end + end + + describe 'an anonymous map' do + subject { Riak::Crdt::Map.new bucket, nil } + it 'accepts a Riak-assigned name' do + subject.registers['coat_pattern'] = 'tabby' + expect(subject.key).to be + expect(subject.registers['coat_pattern']).to eq 'tabby' + end end end describe 'counters' do subject { Riak::Crdt::Counter.new bucket, random_key }