yamerl/test/construction/unknown_alias.erl
Jean-Sébastien Pédron 31e0453f04
Move testsuite to plain EUnit
References #15.
2016-11-10 09:23:35 +01:00

45 lines
1.0 KiB
Erlang

-module(unknown_alias).
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/construction/" ?MODULE_STRING ".yaml").
setup() ->
application:start(yamerl).
simple_test_() ->
{setup,
fun setup/0,
[
?_assertThrow(
{yamerl_exception,
[{yamerl_parsing_error,error,
"No anchor corresponds to alias \"anchor\"",
2,3,no_matching_anchor,
{yamerl_alias,2,3,"anchor"},
[]}
]
},
yamerl_constr:file(?FILENAME, [{detailed_constr, false}])
)
]
}.
detailed_test_() ->
{setup,
fun setup/0,
[
?_assertThrow(
{yamerl_exception,
[{yamerl_parsing_error,error,
"No anchor corresponds to alias \"anchor\"",
2,3,no_matching_anchor,
{yamerl_alias,2,3,"anchor"},
[]}
]
},
yamerl_constr:file(?FILENAME, [{detailed_constr, true}])
)
]
}.