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 Pragmatic topics Top

New
Alexandr
Hi everyone! There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
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
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
dsmith42
Hey there, I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “>...
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
New
davetron5000
Hello faithful readers! If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New

Other popular topics Top

AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
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
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
New

Latest in PragProg

View all threads ❯