Test for single arity failures

This commit is contained in:
Felipe Sere
2016-12-23 23:53:41 +01:00
parent cf244e673f
commit f797ca8e80
2 changed files with 20 additions and 0 deletions

View File

@@ -37,6 +37,15 @@ defmodule FailureTests do
"""
end
test "single arity failure" do
[koan] = SingleArity.all_koans
error = apply(SingleArity, koan, []) |> error()
assert Failure.format_failure(error) == """
Assertion failed in some_file.ex:42\nmatch?(:foo, ___)
"""
end
defp error(error) do
%{
error: error,

View File

@@ -0,0 +1,11 @@
defmodule SingleArity do
use Koans
@intro """
A koan with single arity testing
"""
koan "Only one" do
assert match?(:foo, ___)
end
end