@meikemertsch: I don't understand the gist, and it doesn't even have atoms.. What was wrong with the broken version that you posted?
Hi @ericlavigne. It doesn't need atoms. That was just a simplification. The gist is not a broken version but just a snippet that you can take as an overview. Obviously I didn't deliver what create-user entails (there you could put an atom creation function, but at my current problem it's not an atom but a database call) or any of the other functions. May I assume that you're new to clojure or even programming? Then I'd talk you more through it but I don't want to bore you if you aren't
Experienced in programming and Clojure, but not this library. I would expect "expect" to be an assertion and for true and @user to be equal, therefore your assertion should pass. Why did your assertion not pass in the atom-using code that you pasted into this channel?
Ah that explains something.. Here's what Jay answered. Maybe that is more elaborate than whatever I could write: https://twitter.com/thejayfields/status/655770660988395521
He also gave me a gist https://gist.github.com/jaycfields/d13528c9cd6bb86122b7 that I reformulated a little as it is in my case less readable than what I wrote
Okay, that suggests macros involved and changing the order of evaluation. Suggests why it might be confusing but not how it actually happens. Also makes me think that "expect" is a leaky abstraction. The gist is meant to communicate that let bindings need to be inside of the "expect" form?
They can also be outside. The important part is that the result is let-bound before the deletion and can be accessed when the expectation is taking action
I understand that is not necessary with clojure.test We are however already working with expectations and I am not unhappy about it