test and fix for Grid#delete

This commit is contained in:
Mike Dirolf 2010-03-23 17:00:31 -04:00
parent 3fdd8c3f7a
commit aa86c03bd5
2 changed files with 2 additions and 1 deletions

View File

@ -78,7 +78,7 @@ module Mongo
# @return [Boolean]
def delete(id)
@files.remove({"_id" => id})
@chunks.remove({"_id" => id})
@chunks.remove({"files_id" => id})
end
private

View File

@ -42,6 +42,7 @@ class GridTest < Test::Unit::TestCase
assert_raise GridError do
@grid.get(@id)
end
assert_equal nil, @db['test-fs']['chunks'].find_one({:files_id => @id})
end
end