Testing Elixir: use `setup` instead of `setup_all` in code example (page 16)

The code on page 16 of beta 6 uses setup_all but I believe this should be setup. The code in response_parser_test.bak.exs uses setup and the use of setup_all throws an error.

3 Likes

Yep, I’ve just found this too.

Unfortunately, the book has been finalized now, so I doubt they’ll fix it. Maybe they will publish fixed versions of the ebooks?

Interestingly, this error is not present in B4, but it is in the final Beta (B7).

I know they are demonstrating the use of setup here, but considering that the setup block is only used by the first test, it would be better to just do it as part of that test. As a compromise, a better fix might be to move the setup_all block outside of the describe block, so that it only runs once for all the tests.