represent inspected ObjectID using extended JSON format
This commit is contained in:
parent
acc42dce65
commit
cc0192b2cc
|
@ -127,7 +127,7 @@ module BSON
|
|||
end
|
||||
|
||||
def inspect
|
||||
"ObjectID('#{to_s}')"
|
||||
{"$oid" => to_s}
|
||||
end
|
||||
|
||||
# Convert to MongoDB extended JSON format. Since JSON includes type information,
|
||||
|
|
|
@ -50,7 +50,8 @@ class ObjectIDTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_inspect
|
||||
assert_equal "ObjectID('#{@o.to_s}')", @o.inspect
|
||||
obj = {'$oid' => @o.to_s}
|
||||
assert_equal obj, @o.inspect
|
||||
end
|
||||
|
||||
def test_save_and_restore
|
||||
|
|
Loading…
Reference in New Issue