Skip to content

Commit

Permalink
test: some test coverage (#3)
Browse files Browse the repository at this point in the history
* test: adds test coverage to Juggler.init

* ci: enables mix test

* build(deps): support elixir 1.15

* test description
  • Loading branch information
grzuy authored Feb 5, 2024
1 parent c5b1300 commit 6779ef3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ jobs:
- run: mix deps.compile
- run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
# TODO
# - run: mix test
- run: mix test
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Juggler.MixProject do
[
app: :juggler,
version: "0.1.0",
elixir: "~> 1.16",
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps()
]
Expand Down
19 changes: 17 additions & 2 deletions 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

test "greets the world" do
assert Juggler.hello() == :world
@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 "init/0 generates juggles file" do
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 6779ef3

Please sign in to comment.