Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1006 Bytes

13.13.md

File metadata and controls

53 lines (38 loc) · 1006 Bytes

@doc に書いた iex を用いたサンプルコードはテストできる ...> も再現する必要がある

goh@goh% mix test test/doc_test.exs
Compiling 2 files (.ex)
.....

Finished in 0.1 seconds
5 doctests, 0 failures

Randomized with seed 136749
goh@goh% mix test
................

Finished in 0.2 seconds
7 doctests, 9 tests, 0 failures

Randomized with seed 269476

エラーが発生するように Issues.TableFormatter.printable/1 のサンプルコードを変更

iex> Issues.TableFormatter.pritable(99)
"99.0"
goh@goh% mix test test/doc_test.exs
Compiling 2 files (.ex)
....

  1) doctest Issues.TableFormatter.printable/1 (2) (DocTest)
     test/doc_test.exs:3
     Doctest failed
     code:  Issues.TableFormatter.printable(99) === "99.0"
     left:  "99"
     right: "99.0"
     stacktrace:
       lib/issues/table_formatter.ex:46: Issues.TableFormatter (module)



Finished in 0.1 seconds
5 doctests, 1 failure

Randomized with seed 632235