While here, make the object be an elixir struct instead of delegating to the erlang code. As part of this, geef_nif:commit_tree() has been fixed to return the id, insted of the type, as we know it's going to be a tree, but not then id.
24 lines
466 B
Elixir
24 lines
466 B
Elixir
defmodule ObjectTest do
|
|
use ExUnit.Case
|
|
use Geef
|
|
import RepoHelpers
|
|
|
|
setup do
|
|
{repo, path} = tmp_bare()
|
|
Process.link(repo)
|
|
on_exit(fn -> File.rm_rf!(path) end)
|
|
{:ok, [repo: repo, path: path]}
|
|
end
|
|
|
|
test "object OO helpers", meta do
|
|
repo = meta[:repo]
|
|
{ :ok, odb } = Repository.odb(repo)
|
|
#{ :ok, index } = :geef_index.new
|
|
|
|
content = "I'm some content"
|
|
Odb.write(odb, content, :blob)
|
|
|
|
Repository.stop(repo)
|
|
end
|
|
end
|