How dare you test a private method

29-Sep-2023 531
I feel inspired to talk more about “testing a private method” (gasp!). Since people seem to get upset about it.Where did this idea of it being bad even come from? I remember when learning to code it was all over the place. Blog posts, books, podcasts.I remember being asked it as a trick question in interviews: "which code should you test?". Then the interviewer would nod as soon as I'd say "the public methods, never private!", to signal we have read the same blog posts.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle