Add a tiny elixir test
This commit is contained in:
@@ -3,6 +3,7 @@ defmodule Geef do
|
|||||||
defmacro __using__(_) do
|
defmacro __using__(_) do
|
||||||
quote do
|
quote do
|
||||||
alias Geef.Repository
|
alias Geef.Repository
|
||||||
|
alias Geef.Odb
|
||||||
alias Geef.Reference
|
alias Geef.Reference
|
||||||
alias Geef.Object
|
alias Geef.Object
|
||||||
alias Geef.Commit
|
alias Geef.Commit
|
||||||
|
|||||||
23
test/object_test.exs
Normal file
23
test/object_test.exs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
Code.require_file "../test_helper.exs", __FILE__
|
||||||
|
|
||||||
|
defmodule ObjectTest do
|
||||||
|
use ExUnit.Case
|
||||||
|
use Geef
|
||||||
|
|
||||||
|
defp tmp_dir do
|
||||||
|
{a, b, c} = :erlang.now()
|
||||||
|
n = node()
|
||||||
|
dir = :io_lib.format("geef-~p~p~p~p.git", [n, a, b, c])
|
||||||
|
Path.join(System.tmp_dir!, dir)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "object OO helpers" do
|
||||||
|
dir = tmp_dir
|
||||||
|
{ :ok, repo } = Repository.init(dir, true)
|
||||||
|
{ :ok, odb } = Repository.odb(repo)
|
||||||
|
#{ :ok, index } = :geef_index.new
|
||||||
|
|
||||||
|
content = "I'm some content"
|
||||||
|
Odb.write(odb, content, :blob)
|
||||||
|
end
|
||||||
|
end
|
||||||
1
test/test_helper.exs
Normal file
1
test/test_helper.exs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ExUnit.start
|
||||||
Reference in New Issue
Block a user