Sha256: c63f212bcdd1dedb8e6ac3e4bf38f0e8620e36007517624e84b03c79d9170ebe
Contents?: true
Size: 892 Bytes
Versions: 29
Compression:
Stored size: 892 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe BSON::ObjectId do describe "#as_json" do let(:object_id) do described_class.new end context "when object_id_as_json_oid is not set" do config_override :object_id_as_json_oid, false it "uses bson-ruby's implementation of as_json" do expect(object_id.as_json).to eq(object_id.bson_ruby_as_json) end end context "when object_id_as_json_oid is set" do config_override :object_id_as_json_oid, true it "returns the $oid plus string" do expect(object_id.as_json).to eq("$oid" => object_id.to_s) end end end end describe BSON::Document do describe "#symbolize_keys" do let(:doc) do described_class.new("foo" => "bar") end it "returns key as symbol" do expect(doc.symbolize_keys.keys).to eq [:foo] end end end
Version data entries
29 entries across 29 versions & 1 rubygems