test and fix for Grid#delete
This commit is contained in:
parent
d7fda8240f
commit
bca5daa87b
|
@ -78,7 +78,7 @@ module Mongo
|
||||||
# @return [Boolean]
|
# @return [Boolean]
|
||||||
def delete(id)
|
def delete(id)
|
||||||
@files.remove({"_id" => id})
|
@files.remove({"_id" => id})
|
||||||
@chunks.remove({"_id" => id})
|
@chunks.remove({"files_id" => id})
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -42,6 +42,7 @@ class GridTest < Test::Unit::TestCase
|
||||||
assert_raise GridError do
|
assert_raise GridError do
|
||||||
@grid.get(@id)
|
@grid.get(@id)
|
||||||
end
|
end
|
||||||
|
assert_equal nil, @db['test-fs']['chunks'].find_one({:files_id => @id})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue