Sha256: 3cda4f59c47d78f15665d032abaf2084f8e6b0e24736e0a33669a766f35f8479
Contents?: true
Size: 594 Bytes
Versions: 1
Compression:
Stored size: 594 Bytes
Contents
require 'helper' describe "Mongo atomic adapter" do before do @client = Mongo::MongoClient.new.db('test')['test'] @adapter = Adapter[adapter_name].new(@client) @adapter.clear end let(:adapter_name) { :mongo_atomic } let(:adapter) { @adapter } let(:client) { @client } it_should_behave_like 'a mongo adapter' it "allows updating only part of a document" do oid = BSON::ObjectId.new adapter.write(oid, {'a' => 'c', 'b' => 'd'}) adapter.write(oid, {'a' => 'z'}) expect(adapter.read(oid)).to eq({ 'a' => 'z', 'b' => 'd', }) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
adapter-mongo-0.8.1 | spec/mongo_atomic_spec.rb |