Sha256: 08ad7b6149f206d9695e7303f4e8a1371ba445dfa7ed7e0d9cded2a5f7839623
Contents?: true
Size: 697 Bytes
Versions: 2
Compression:
Stored size: 697 Bytes
Contents
require 'rubygems' require 'pathname' root_path = Pathname(__FILE__).dirname.join('..').expand_path lib_path = root_path.join('lib') $:.unshift(lib_path) require 'adapter/mongo' key = BSON::ObjectId.new client = Mongo::MongoClient.new.db('adapter')['testing'] adapter = Adapter[:mongo].new(client) adapter.clear adapter.write(key, {'some' => 'thing'}) puts 'Should be {"some" => "thing"}: ' + adapter.read(key).inspect adapter.delete(key) puts 'Should be nil: ' + adapter.read(key).inspect adapter.write(key, {'some' => 'thing'}) adapter.clear puts 'Should be nil: ' + adapter.read(key).inspect puts 'Should be {"some" => "thing"}: ' + adapter.fetch(key, {'some' => 'thing'}).inspect
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
adapter-mongo-0.8.1 | examples/mongo.rb |
adapter-mongo-0.8.0 | examples/mongo.rb |