small medium large xlarge

26 Oct 2013, 20:00
Rick DeNatale (15 posts)

I’m now at this section.

I’ve put the @doc stuff in Issues.TableFormatter.ex and added dockets.exs to the test directory, but when I run:

‘$mix test test/doc.exs

Finished in 0.00 seconds (0.00s on load, 0.00s on tests) 0 tests, 0 failures’

It doesn’t seem to be finding the examples. I’ve googled the elixir docs and from what I’m reading that should be pretty bullet-proof.

When I run the mix command it’s definitely compiling the Issues.TableFormatter class, both because it says it is after I change it, and I get a syntax error if I inject one.

It’s as if it isn’t finding any doc comments.

If I use iex -cSmix I can do this:

‘$iex -S mix Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Interactive Elixir (0.10.3) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> Issues.TableFormatter Issues.TableFormatter iex(2)> h Issues.TableFormatter No documentation for Issues.TableFormatter was found iex(3)> h Issues.TableFormatter.split_into_columns/2 * def split_into_columns(rows, headers)

Given a list or rows, where each row contains a keyed list of columns, return a list containing lists of the data in each column. The headers parameter contains the list of columns to extract


iex> list = [ [ {“a”, “1”}, {“b”, “2”}, {“c”, “3”}], …> [ {“a”, “4”}, {“b”, “5”}, {“c”, “6”}] ] iex> Issues.TableFormatter.split_into_columns(list, [ “a”, “b”, “c” ]) [ [“1”, “4”], [“2”, “5”], [“3”, “6”] ]’

So the doc is there, at least for the functions, but dockest doesn’t seem to see it.

Does anyone have any ideas what’s going on here?

26 Oct 2013, 20:02
Rick DeNatale (15 posts)

I didn’t realize that this forum (i.e. markdown) was going to interpret the three hashes before example as formatting. So don’t be confused by that.

27 Oct 2013, 15:57
Rick DeNatale (15 posts)

Joeé helped with this vis the erlang-lang google group.

The root cause, as I suspected was a typo on my part, the mix command should have been $mix test test/doc_test.exs

In other words, I’d fumble fingered the test file name.

You must be logged in to comment