Skip to content

Commit

Permalink
Merge pull request #91 from vukanac/master
Browse files Browse the repository at this point in the history
Adds test to cover one of Mongo.find/4 errors
  • Loading branch information
zookzook authored May 19, 2021
2 parents 2b10649 + 3b7f07f commit e868d7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/mongo_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ defmodule Mongo.Test do

assert [%{"foo" => 44}, %{"foo" => 43}] =
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)

# one of error types
assert {:error, %Mongo.Error{message: "unknown top level operator: $foo"}} =
Mongo.find(c.pid, coll, %{"$foo" => []})
end

test "find_one", c do
Expand Down

0 comments on commit e868d7d

Please sign in to comment.