From 54a3cbb3085ce96e6fc75db33e32e0902a42d641 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Tue, 2 Nov 2010 15:40:40 -0400 Subject: [PATCH] minor: test validates that we remove duplicate _id only on insert. --- test/bson/bson_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/bson/bson_test.rb b/test/bson/bson_test.rb index 3999901..2209deb 100644 --- a/test/bson/bson_test.rb +++ b/test/bson/bson_test.rb @@ -437,11 +437,13 @@ class BSONTest < Test::Unit::TestCase # HashWithIndifferentAccess can cause problems for _id but not for other # keys. rather than require rails to test with HWIA directly, we do this # somewhat hacky test. + # + # Note that the driver only eliminates duplicate ids when move_id is true. def test_no_duplicate_id dup = {"_id" => "foo", :_id => "foo"} one = {"_id" => "foo"} - assert_equal @encoder.serialize(one).to_a, @encoder.serialize(dup).to_a + assert_equal @encoder.serialize(one, false, true).to_a, @encoder.serialize(dup, false, true).to_a end def test_duplicate_keys