RUBY-121
This commit is contained in:
parent
b9f579876c
commit
860ab356d2
|
@ -116,7 +116,7 @@ module BSON
|
||||||
raise InvalidDocument, "Document is too large (#{@buf.size}). BSON documents are limited to 4MB (#{4 * 1024 * 1024})."
|
raise InvalidDocument, "Document is too large (#{@buf.size}). BSON documents are limited to 4MB (#{4 * 1024 * 1024})."
|
||||||
end
|
end
|
||||||
@buf.put_int(@buf.size, 0)
|
@buf.put_int(@buf.size, 0)
|
||||||
self
|
@buf
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the array stored in the buffer.
|
# Returns the array stored in the buffer.
|
||||||
|
|
|
@ -22,6 +22,12 @@ class BSONTest < Test::Unit::TestCase
|
||||||
|
|
||||||
include BSON
|
include BSON
|
||||||
|
|
||||||
|
def test_serialize_returns_byte_buffer
|
||||||
|
doc = {'doc' => 'hello, world'}
|
||||||
|
bson = BSON.serialize(doc)
|
||||||
|
assert bson.is_a?(ByteBuffer)
|
||||||
|
end
|
||||||
|
|
||||||
def test_deprecated_bson_module
|
def test_deprecated_bson_module
|
||||||
doc = {'doc' => 'hello, world'}
|
doc = {'doc' => 'hello, world'}
|
||||||
bson = BSON.serialize(doc)
|
bson = BSON.serialize(doc)
|
||||||
|
|
Loading…
Reference in New Issue