diff --git a/include/gurka.hrl b/include/gurka.hrl index 412934605be8a05d5f51a7f00414534d02753352..601b8b61b524cc8b5afbadcc2922cac75132b1ba 100644 --- a/include/gurka.hrl +++ b/include/gurka.hrl @@ -1,7 +1,7 @@ -type phase() :: feature | background | scenario | scenario_outline | meta. --type action() :: desc | title | given | 'when' | then | examples | headers | values | tags. --type tokens() :: [binary()]. --type row() :: pos_integer(). +-type action() :: skip | start | 'end' | desc | title | given | 'when' | then | examples | headers | values | tags | table | docstring. +-type tokens() :: [tokens() | binary() | {table, any()} | {docstring, any()}]. +-type row() :: integer(). -type meta() :: [{atom(),term()}]. -type lines() :: [{row(), binary(), tokens()}]. diff --git a/src/gurka.erl b/src/gurka.erl index 850fe74e8494b44a309154ba04abe4dddc58a88f..4cf0e024b1d04799b47e93417b365bdb3e20cf6f 100644 --- a/src/gurka.erl +++ b/src/gurka.erl @@ -117,7 +117,7 @@ run(Module, Options, FeatureState, ScenarioState, _PreviousPhase, [Step = #step{ [{ok, Step} | run(Module, Options, FeatureState, ScenarioState, Phase, Steps)]. run_outline(Module, Options, FeatureState, ScenarioState, _PreviousPhase, [ExamplesStep = #step{phase = scenario_outline, action = examples, row = ExampleRow, tokens = [Headers | Rows]} | Steps], ScenarioOutline) -> - TaggedHeaders = [<<"<", Header/binary, ">">> || Header <- Headers], + TaggedHeaders = [<<"<", Header/binary, ">">> || Header <- Headers, is_binary(Header)], {Results, _} = lists:mapfoldl(fun(Row, Count) -> Example = lists:zip(TaggedHeaders, Row), Scenario = lists:foldl(fun(Step, ScenarioAcc) -> diff --git a/src/gurka_parser.erl b/src/gurka_parser.erl index 2d0c9a4db6e3c524e15bd7940636d68391759f68..ff876a2dfb8eb9c254d3d398419e25f4090c4d8c 100644 --- a/src/gurka_parser.erl +++ b/src/gurka_parser.erl @@ -20,8 +20,8 @@ parse(File) -> end. -spec process(Phase, Action, Lines) -> Feature when - Phase :: phase(), - Action :: action(), + Phase :: phase() | undefined, + Action :: action() | undefined, Lines :: lines(), Feature :: feature(). process(_Phase, _Action, []) ->