Skip to content

Commit

Permalink
test: adds test coverage to Juggler.init
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Feb 5, 2024
1 parent c5b1300 commit 3129fd7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/juggler_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@ defmodule JugglerTest do
use ExUnit.Case
doctest Juggler

@tmp_path Path.expand("../tmp", __DIR__)

setup do
File.mkdir_p!(@tmp_path)
on_exit(fn -> File.rm_rf(@tmp_path) end)
:ok
end

test "greets the world" do
assert Juggler.hello() == :world
File.cd!(
@tmp_path,
fn ->
refute File.exists?("juggles.exs")
assert Juggler.init() == :ok
assert File.exists?("juggles.exs")
end
)
end
end

0 comments on commit 3129fd7

Please sign in to comment.