Test for single arity failures
This commit is contained in:
@@ -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,
|
||||
|
11
test/support/single_arity_koan.ex
Normal file
11
test/support/single_arity_koan.ex
Normal 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
|
Reference in New Issue
Block a user