#, , , .
TDD, - . , , - . , - : Client.initiate_reviews
, , ( , ). Client.initiate_reviews, , , , , , ?
, , .
, . , :
clients = Client.find_all_due_for_review
for_each client in clients {
review = Review.start_new_for(client)
Letter.send_for_review(review)
}
Then I wrote tests for the methods called in this method that I have to implement. Find_all_due_for_review has no side effects, but return something, so of course you check the return value here and maybe nothing has changed. Repeat until the first test is completed.
This way, every aspect is properly tested, and you can even use some methods that you can reuse.
Hope this helps!
source
share