diff --git a/lib/mongo/collection.rb b/lib/mongo/collection.rb index e17b177..e4a6392 100644 --- a/lib/mongo/collection.rb +++ b/lib/mongo/collection.rb @@ -321,6 +321,7 @@ module Mongo @connection.send_message_with_safe_check(Mongo::Constants::OP_DELETE, message, @db.name, nil, safe) else @connection.send_message(Mongo::Constants::OP_DELETE, message) + true end end diff --git a/test/collection_test.rb b/test/collection_test.rb index 56f6b3f..807c534 100644 --- a/test/collection_test.rb +++ b/test/collection_test.rb @@ -263,13 +263,12 @@ class TestCollection < Test::Unit::TestCase @db = @conn[MONGO_TEST_DB] @test = @db['test-safe-remove'] @test.save({:a => 50}) - @test.remove({}, :safe => true) + assert_equal 1, @test.remove({}, :safe => true)["n"] @test.drop end def test_remove_return_value - assert_equal 50, @@test.remove({}) - assert_equal 57, @@test.remove({"x" => 1}) + assert_equal true, @@test.remove({}) end def test_count