testing

Testing tools, testing philosophy & methodology...
2015-10-24T13:24:27.000039Z

@meikemertsch: I don't understand the gist, and it doesn't even have atoms.. What was wrong with the broken version that you posted?

2015-10-24T13:38:54.000040Z

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

2015-10-24T13:41:26.000041Z

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?

2015-10-24T13:44:03.000043Z

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

2015-10-24T13:45:25.000045Z

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

2015-10-24T13:47:05.000047Z

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?

2015-10-24T13:48:35.000048Z

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

2015-10-24T13:53:05.000049Z

I understand that is not necessary with clojure.test We are however already working with expectations and I am not unhappy about it