Test for RUBY-188

This commit is contained in:
Kyle Banker 2011-01-05 09:28:42 -05:00
parent 9798626053
commit 556d4aa271
1 changed files with 9 additions and 0 deletions

View File

@ -213,6 +213,15 @@ class BSONTest < Test::Unit::TestCase
assert_doc_pass(doc)
end
def test_array_keys
doc = {'doc' => [1, 2, 'a', 'b']}
bson = @encoder.serialize(doc).to_a
assert_equal 48, bson[14]
assert_equal 49, bson[21]
assert_equal 50, bson[28]
assert_equal 51, bson[37]
end
def test_regex
doc = {'doc' => /foobar/i}
assert_doc_pass(doc)