# \#book-testing-elixir

**URL:** https://forum.devtalk.com/tag/book-testing-elixir/381.md

[Latest](https://forum.devtalk.com/latest.md) · [Categories](https://forum.devtalk.com/categories.md) · [Tags](https://forum.devtalk.com/tags.md)

---

## [Testing Elixir: Term not unquoted (page 18)](https://forum.devtalk.com/t/testing-elixir-term-not-unquoted-page-18/247077)

<div class="topic-metadata">

**Author:** [@emptytuple](https://forum.devtalk.com/u/emptytuple)\
**Replies:** 0\
**Last updated:** [8 June 2026 02:31 UTC](https://forum.devtalk.com/t/testing-elixir-term-not-unquoted-page-18/247077 "2026-06-08T02:31:54Z")

</div>

On page 18, there is the code: test "success: recognizes #{condition} as a rainy condition" do … end It is nested within a comprehension and introduces a metaprogramming concept for test generation using code fragmen…

---

## [Testing Elixir: Minor setup innaccuracy (page 12)](https://forum.devtalk.com/t/testing-elixir-minor-setup-innaccuracy-page-12/247076)

<div class="topic-metadata">

**Author:** [@emptytuple](https://forum.devtalk.com/u/emptytuple)\
**Replies:** 0\
**Last updated:** [8 June 2026 02:31 UTC](https://forum.devtalk.com/t/testing-elixir-minor-setup-innaccuracy-page-12/247076 "2026-06-08T02:31:51Z")

</div>

This is a pretty minor erratum, but I feel the need to point out that on page 12, the book states: Your setups can build on top of each other…the setup in your describe can accept values passed to it from the higher-up…

---

## [Testing Elixir: Wrong spec for \`parse\_response/1\` (page 5)](https://forum.devtalk.com/t/testing-elixir-wrong-spec-for-parse-response-1-page-5/247073)

<div class="topic-metadata">

**Author:** [@emptytuple](https://forum.devtalk.com/u/emptytuple)\
**Replies:** 0\
**Last updated:** [7 June 2026 22:12 UTC](https://forum.devtalk.com/t/testing-elixir-wrong-spec-for-parse-response-1-page-5/247073 "2026-06-07T22:12:43Z")

</div>

This one had me second-guessing myself, but I’m fairly certain this is an error in both the book’s code sample and the provided source: @spec parse\_response(Weather.t()) :: {:ok, list(Weather.t())} | {:error, atom()} T…

---

## [Testing Elixir: Mox mode is private since the test is running with async (page 84-)](https://forum.devtalk.com/t/testing-elixir-mox-mode-is-private-since-the-test-is-running-with-async-page-84/63947)

<div class="topic-metadata">

**Author:** [@fabriziosestito](https://forum.devtalk.com/u/fabriziosestito)\
**Replies:** 1\
**Last updated:** [13 July 2022 17:18 UTC](https://forum.devtalk.com/t/testing-elixir-mox-mode-is-private-since-the-test-is-running-with-async-page-84/63947 "2022-07-13T17:18:05Z")

</div>

Andrea Leopardi (@whatyouhide) and Jeffrey Matthias (@idlehands), SoggyWaffle.WeatherCheckerTest is using the :set\_mox\_from\_context setup function, this means that Mox will run in private mode since async: true is passe…

---

## [Testing Elixir - malformed\_day doesn't test for malformed day (page 22)](https://forum.devtalk.com/t/testing-elixir-malformed-day-doesnt-test-for-malformed-day-page-22/14431)

<div class="topic-metadata">

**Author:** [@adamu](https://forum.devtalk.com/u/adamu)\
**Replies:** 0\
**Last updated:** [23 July 2021 10:11 UTC](https://forum.devtalk.com/t/testing-elixir-malformed-day-doesnt-test-for-malformed-day-page-22/14431 "2021-07-23T10:11:00Z")

</div>

Sorry, I know you asked us not to submit more errata on a recent podcast, but in the interest of correctness… The test on p22 sets up the following data : malformed\_day = %{ # wrong key "datetime" =\> 1\_574\_35…

---

## [Testing Elixir: use \`setup\` instead of \`setup\_all\` in code example (page 16)](https://forum.devtalk.com/t/testing-elixir-use-setup-instead-of-setup-all-in-code-example-page-16/10528)

<div class="topic-metadata">

**Author:** [@rubyist](https://forum.devtalk.com/u/rubyist)\
**Replies:** 1\
**Last updated:** [23 July 2021 06:51 UTC](https://forum.devtalk.com/t/testing-elixir-use-setup-instead-of-setup-all-in-code-example-page-16/10528 "2021-07-23T06:51:26Z")

</div>

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.

---

## [Testing Elixir: assert\_receive throws "no matching message" error (page 85, B6.0)](https://forum.devtalk.com/t/testing-elixir-assert-receive-throws-no-matching-message-error-page-85-b6-0/9830)

<div class="topic-metadata">

**Author:** [@shaolang](https://forum.devtalk.com/u/shaolang)\
**Replies:** 1\
**Last updated:** [24 May 2021 10:10 UTC](https://forum.devtalk.com/t/testing-elixir-assert-receive-throws-no-matching-message-error-page-85-b6-0/9830 "2021-05-24T10:10:13Z")

</div>

First iteration that uses Process.sleep/1 works but the stab on using assert\_receive doesn’t. I’ve even increased the timeout to 5,000 milliseconds for assert\_receive but the test still fails with “no matching message”. …

---

## [Get 50% off these PragProg books during our Think Again Sale](https://forum.devtalk.com/t/get-50-off-these-pragprog-books-during-our-think-again-sale/9523)

<div class="topic-metadata">

**Author:** [@Margaret](https://forum.devtalk.com/u/Margaret)\
**Replies:** 2\
**Last updated:** [11 May 2021 23:06 UTC](https://forum.devtalk.com/t/get-50-off-these-pragprog-books-during-our-think-again-sale/9523 "2021-05-11T23:06:15Z")

</div>

Think Again 50% Off Sale » The theme of this sale is new perspectives on familiar topics. Enter coupon code ThinkAgain2021 at checkout to save 50% on any of the following titles. Offer not valid for previous purchases.…

---

## [Testing Elixir: B5 Page 183 wrong url stream\_data repo](https://forum.devtalk.com/t/testing-elixir-b5-page-183-wrong-url-stream-data-repo/8756)

<div class="topic-metadata">

**Author:** [@metal](https://forum.devtalk.com/u/metal)\
**Replies:** 1\
**Last updated:** [18 April 2021 13:10 UTC](https://forum.devtalk.com/t/testing-elixir-b5-page-183-wrong-url-stream-data-repo/8756 "2021-04-18T13:10:39Z")

</div>

Title: Testing Elixir: B5 Page 183 Url for stream\_data repo should be https://github.com/whatyouhide/stream\_data instead of https://github.com/whatyohide/stream\_data Did the author forget his own GitHub URL? …

---

## [Testing Elixir: B5 Page 172 File name should be error\_helpers.ex](https://forum.devtalk.com/t/testing-elixir-b5-page-172-file-name-should-be-error-helpers-ex/8743)

<div class="topic-metadata">

**Author:** [@metal](https://forum.devtalk.com/u/metal)\
**Replies:** 0\
**Last updated:** [13 April 2021 06:09 UTC](https://forum.devtalk.com/t/testing-elixir-b5-page-172-file-name-should-be-error-helpers-ex/8743 "2021-04-13T06:09:02Z")

</div>

Title: Testing Elixir B5 (page 172) Inside the “Modified Boiler Plate” info box, the filename for error\_tag/3 should be “lib/not\_skull\_web/views/error\_helpers.ex” instead of “not\_skull/test/support/assertion\_helpers.ex”…

---

## [Testing Elixir: MIX\_ENV in Makefile](https://forum.devtalk.com/t/testing-elixir-mix-env-in-makefile/8544)

<div class="topic-metadata">

**Author:** [@metal](https://forum.devtalk.com/u/metal)\
**Replies:** 1\
**Last updated:** [6 April 2021 16:33 UTC](https://forum.devtalk.com/t/testing-elixir-mix-env-in-makefile/8544 "2021-04-06T16:33:02Z")

</div>

Title: Testing Elixir (Source code) In the Makefile, provided in source code located at \[code/testing\_ecto & code/testing\_phoenix/not\_skull\], should MIX\_test=test and MIX\_dev=dev be MIX\_ENV=test and MIX\_ENV=dev? Thanks …

---

## [Testing Elixir: UserDatabaseSchema should be UserBasicSchema](https://forum.devtalk.com/t/testing-elixir-userdatabaseschema-should-be-userbasicschema/8529)

<div class="topic-metadata">

**Author:** [@metal](https://forum.devtalk.com/u/metal)\
**Replies:** 0\
**Last updated:** [6 April 2021 11:18 UTC](https://forum.devtalk.com/t/testing-elixir-userdatabaseschema-should-be-userbasicschema/8529 "2021-04-06T11:18:52Z")

</div>

Title: Testing Elixir B5: page 128 Under Updating our Tests to include Database fields, Let’s update the test name to TestingEcto.Schemas.UserDatabaseSchemaTest, and also replace all of our references to UserDatabaseSc…

---

## [Testing Elixir: logic error in code sample: with\_authenticated\_user/1 (Page 25)](https://forum.devtalk.com/t/testing-elixir-logic-error-in-code-sample-with-authenticated-user-1-page-25/1288)

<div class="topic-metadata">

**Author:** [@scottswezey](https://forum.devtalk.com/u/scottswezey)\
**Replies:** 6\
**Last updated:** [1 April 2021 01:57 UTC](https://forum.devtalk.com/t/testing-elixir-logic-error-in-code-sample-with-authenticated-user-1-page-25/1288 "2021-04-01T01:57:56Z")

</div>

The with\_authenticated\_user/1 code sample on PDF page 25 in B2.0 returns the user object, and not the authenticated\_user object as I expect it should. Leaving the code as-is would probably be considered a logic error in …

---

## [Testing Elixir: Test pid confusion (page 28)](https://forum.devtalk.com/t/testing-elixir-test-pid-confusion-page-28/2861)

<div class="topic-metadata">

**Author:** [@adamu](https://forum.devtalk.com/u/adamu)\
**Replies:** 2\
**Last updated:** [12 February 2021 15:49 UTC](https://forum.devtalk.com/t/testing-elixir-test-pid-confusion-page-28/2861 "2021-02-12T15:49:26Z")

</div>

The text reads: Additionally, we have to define the test’s pid outside of the function because self() wouldn’t be evaluated until the function is executed, inside the process of the code under test, which could have a …

---

## [Testing Elixir:Typo (page 85)](https://forum.devtalk.com/t/testing-elixir-typo-page-85/1330)

<div class="topic-metadata">

**Author:** [@imahiro](https://forum.devtalk.com/u/imahiro)\
**Replies:** 1\
**Last updated:** [12 February 2021 15:38 UTC](https://forum.devtalk.com/t/testing-elixir-typo-page-85/1330 "2021-02-12T15:38:59Z")

</div>

Is “make both functions public (def instead of def)” on PDF page 85 in B2.0 “make both functions public (def instead of defp)” ?

---

## [Testing Elixir - Typo (page 7)](https://forum.devtalk.com/t/testing-elixir-typo-page-7/902)

<div class="topic-metadata">

**Author:** [@jasullivan](https://forum.devtalk.com/u/jasullivan)\
**Replies:** 3\
**Last updated:** [12 February 2021 12:59 UTC](https://forum.devtalk.com/t/testing-elixir-typo-page-7/902 "2021-02-12T12:59:31Z")

</div>

I believe the second to the last sentence in the third paragraph contains a few typos. The single element pattern in our anonymous function implies, more specifically, that the the response it a list.

---

## [Testing Elixir: test code typo (page 71, beta 4)](https://forum.devtalk.com/t/testing-elixir-test-code-typo-page-71-beta-4/6897)

<div class="topic-metadata">

**Author:** [@shaolang](https://forum.devtalk.com/u/shaolang)\
**Replies:** 1\
**Last updated:** [12 February 2021 12:07 UTC](https://forum.devtalk.com/t/testing-elixir-test-code-typo-page-71-beta-4/6897 "2021-02-12T12:07:42Z")

</div>

expected\_list has 10 as its first element but assert at end of test pushes 3, not 10.

---

## [Testing Elixir: test code typo (page 70, beta 4)](https://forum.devtalk.com/t/testing-elixir-test-code-typo-page-70-beta-4/6898)

<div class="topic-metadata">

**Author:** [@shaolang](https://forum.devtalk.com/u/shaolang)\
**Replies:** 1\
**Last updated:** [12 February 2021 10:39 UTC](https://forum.devtalk.com/t/testing-elixir-test-code-typo-page-70-beta-4/6898 "2021-02-12T10:39:03Z")

</div>

There’s no RollingAverageMeasurements.add\_element/1 variant. The two calls to RollingAverageMeasurements.add\_element should either be piped with measurements as the target, or add measurements as the first parameter, e.g…

---

## [Testing Elixir: test code typo (page 72, beta 4)](https://forum.devtalk.com/t/testing-elixir-test-code-typo-page-72-beta-4/6899)

<div class="topic-metadata">

**Author:** [@shaolang](https://forum.devtalk.com/u/shaolang)\
**Replies:** 1\
**Last updated:** [12 February 2021 10:36 UTC](https://forum.devtalk.com/t/testing-elixir-test-code-typo-page-72-beta-4/6899 "2021-02-12T10:36:05Z")

</div>

A few issues on code to test average/1: add\_element/2 in Enum.reduce/3 keeps adding 1 (one) to the list, but numbers in input\_list aren’t just ones. average/1 in assert should be given measurements, not input\_list. T…

---

## [Testing Elixir (PragProg)](https://forum.devtalk.com/t/testing-elixir-pragprog/672)

<div class="topic-metadata">

**Author:** [@PragmaticBookshelf](https://forum.devtalk.com/u/PragmaticBookshelf)\
**Replies:** 8\
**Last updated:** [5 January 2021 06:17 UTC](https://forum.devtalk.com/t/testing-elixir-pragprog/672 "2021-01-05T06:17:50Z")

</div>

Write Elixir tests that you can be proud of. Dive into Elixir’s test philosophy and gain mastery over the terminology and concepts that underlie good tests Andrea Leopardi @whatyouhide and Jeffrey Matthias @idlehan…

---

## [Testing Elixir - Quality Assurance vs. Quality Control - errata page iii](https://forum.devtalk.com/t/testing-elixir-quality-assurance-vs-quality-control-errata-page-iii/929)

<div class="topic-metadata">

**Author:** [@laurent](https://forum.devtalk.com/u/laurent)\
**Replies:** 0\
**Last updated:** [28 June 2020 11:42 UTC](https://forum.devtalk.com/t/testing-elixir-quality-assurance-vs-quality-control-errata-page-iii/929 "2020-06-28T11:42:06Z")

</div>

As per ISO 21500: Quality control is a set of activities for ensuring quality in the outputs of the project (the code here) whereas quality assurance is a set of activities for ensuring quality in the processes by whic…

---

## [Testing Elixir - MapSet.new vs. Enum.sort in unit test example](https://forum.devtalk.com/t/testing-elixir-mapset-new-vs-enum-sort-in-unit-test-example/892)

<div class="topic-metadata">

**Author:** [@dotdotdotpaul](https://forum.devtalk.com/u/dotdotdotpaul)\
**Replies:** 5\
**Last updated:** [25 June 2020 16:13 UTC](https://forum.devtalk.com/t/testing-elixir-mapset-new-vs-enum-sort-in-unit-test-example/892 "2020-06-25T16:13:27Z")

</div>

Title: Testing Elixir - MapSet.new vs. Enum.sort (p. 80 PDF) The example on this page shows an assertion with the code: code: assert Enum.sort(actual\_fields\_with\_types) == Enum.sort(@expected\_fields\_with\_types)…
