Skip to content
This repository has been archived by the owner on May 21, 2023. It is now read-only.

Commit

Permalink
Fix issue parroty#43: Formatter fails with no configured tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devstopfix committed Aug 7, 2019
1 parent 3c0096a commit 3e2c9c6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ First add ExCheck and [triq][triq] to your project's dependencies in `mix.exs`.
```Elixir
defp deps do
[
{:excheck, git: "https://github.com/devstopfix/excheck.git", tag: "0.7.4", only: :test},
{:excheck, git: "https://github.com/devstopfix/excheck.git", tag: "0.7.5", only: :test},
{:triq, "~> 1.3"}
]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/excheck.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule ExCheck do
example = :triq.counterexample()
{:error, %ExCheck.Error{message: "check failed: Counterexample: #{inspect example}"}}
{:EXIT, %{__struct__: _, message: _} = e} ->
example = :triq.counterexample()
_example = :triq.counterexample()
{:error, e}
error ->
example = :triq.counterexample()
Expand Down
4 changes: 3 additions & 1 deletion lib/excheck/formatter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ defmodule ExCheck.Formatter do
tests_counter + ExCheck.TriqAgent.get_tests_count
end

defp update_tests_counter(tests_counter) when is_map(tests_counter) do
defp update_tests_counter(%{test: _} = tests_counter) when is_map(tests_counter) do
%{tests_counter | test: tests_counter.test + ExCheck.TriqAgent.get_tests_count}
end

defp update_tests_counter(m) when is_map(m), do: m
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule ExCheck.Mixfile do
name: "ExCheck",
source_url: "https://github.com/devstopfix/excheck",
homepage_url: "https://github.com/parroty/ExCheck.git",
version: "0.7.4",
version: "0.7.5",
elixir: "~> 1.5",
deps: deps(),
description: description(),
Expand Down

0 comments on commit 3e2c9c6

Please sign in to comment.