arcanemachine

arcanemachine

Chapter 7: "There’s no code for you to write in this chapter" (page 168)

When starting Chapter 7 (All About Testing), there is an aside that says:

There’s no code for you to write in this chapter — Tunez comes with a full set of tests pre-prepared, but they’re all skipped and commented out…

Knowing this, I proceed to the first test:

test "when there is no data, nothing is returned" do

However, there is no matching code block in my Tunez repo with this text in it.

So I do need to write some code in this chapter?

I had assumed the code would be commented out, but in the repo.

Thanks

Most Liked

sevenseacat

sevenseacat

Author of Ash Framework

Right, I see how that’s confusing! Some of the tests in the book, such as that initial one, are meant as demonstrations of tests - you can write them, and they will pass, but we haven’t included them in the app. This chapter is more illustrative, meant to show possibilities that you can apply when you need them.

As we state later on (perhaps way too late) - realistically, we wouldn’t write all of the tests that we demonstrate, because Tunez isn’t complex enough to need them. The generator we write is “real”, as are the interface tests and some of the policy tests, but in reality most of our “real” tests cover action calls, the search UI, and policies, and aren’t super interesting! Once you’ve seen one, you’ve got an idea of how the rest work.

I’ll have a think how this can be improved for the next beta. I think the approach in the Tunez app is correct (don’t fill it full of tests for the sake of tests) but the description in the book needs to be clearer…

Popular Prag Prog topics Top

brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
mikecargal
Title: Hands-on Rust: question about get_component (page 295) (feel free to respond. “You dug you’re own hole… good luck”) I have somet...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
New
s2k
Hi all, currently I wonder how the Tailwind colours work (or don’t work). For example, in app/views/layouts/application.html.erb I have...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
dachristenson
I just bought this book to learn about Android development, and I’m already running into a major issue in Ch. 1, p. 20: “Update activity...
New

Other popular topics Top

malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New

Latest in PragProg

View all threads ❯