Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions templates/erlang.eunit/%kata_file%.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-module(%kata_file%).
-export([%kata_file%/0]).
-include_lib("eunit/include/eunit.hrl").


%kata_file%() ->
true.

%kata_file%_test_() ->
{ setup,
fun setup/0,
fun cleanup/1,[
?_assert(%kata_file%())
]}.

setup() ->
ok.

cleanup(_Pid) ->
ok.
3 changes: 3 additions & 0 deletions templates/erlang.eunit/.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework: erlang.eunit
source_files: .*\.erl
success_detection: "Test passed\.|All \d+ tests passed\."
8 changes: 8 additions & 0 deletions templates/erlang.eunit/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
These files were created:
README is what you are currently reading
run-once.%sh% runs your tests once
run-endless.%sh% runs your tests endlessly via run-once.%sh%

Run run-endless.%sh% and start your kata. (On Mac/Linux you have to call ./run-endless.%sh%.)

The support for Erlang/EUnit was contributed by Jan-Felix Wittmann (Twitter: @leobm).
1 change: 1 addition & 0 deletions templates/erlang.eunit/run-endless.%sh%
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
codersdojo start ./run-once.%sh%
5 changes: 5 additions & 0 deletions templates/erlang.eunit/run-once.%sh%
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test -e ebin || mkdir ebin
rm ebin/*
erlc -o ebin/ %kata_file%.erl
erl -noshell -pa ebin -s init stop -eval "eunit:test(%kata_file%, [verbose])"