fix(): fix stream

This commit is contained in:
Ryan Schmukler 2016-08-18 19:14:50 -07:00
parent 584a3832f9
commit 7f5dbac8b6
2 changed files with 10 additions and 1 deletions

View File

@ -247,7 +247,7 @@ defmodule Rox do
Stream.resource(fn ->
{:ok, iter } = :erocksdb.iterator(db, read_opts)
{iter, :first}
end, scan_or_decode, fn {iter,_} ->
end, scan_or_decode, fn iter ->
:erocksdb.iterator_close(iter)
end)
end

View File

@ -30,4 +30,13 @@ defmodule RoxTest do
assert count == 1
end
test "stream", %{db: db} do
:ok = Rox.put(db, "key", "val")
count = Rox.stream(db)
|> Enum.count
assert count == 1
end
end