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

mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
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
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
leonW
I ran this command after installing the sample application: $ cards add do something --owner Brian And got a file not found error: Fil...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
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
creminology
Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
New
jwandekoken
Book: Programming Phoenix LiveView, page 142 (157/378), file lib/pento_web/live/product_live/form_component.ex, in the function below: d...
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
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1021 17087 374
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New

Sub Categories: