Skip to content

Commit e868d7d

Browse files
authored
Merge pull request #91 from vukanac/master
Adds test to cover one of Mongo.find/4 errors
2 parents 2b10649 + 3b7f07f commit e868d7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/mongo_test.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ defmodule Mongo.Test do
199199

200200
assert [%{"foo" => 44}, %{"foo" => 43}] =
201201
Mongo.find(c.pid, coll, %{}, sort: [foo: -1], batch_size: 2, limit: 2) |> Enum.to_list |> Enum.map(fn m -> Map.pop(m, "_id") |> elem(1) end)
202+
203+
# one of error types
204+
assert {:error, %Mongo.Error{message: "unknown top level operator: $foo"}} =
205+
Mongo.find(c.pid, coll, %{"$foo" => []})
202206
end
203207

204208
test "find_one", c do

0 commit comments

Comments
 (0)