Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Then don't write meaningless types. If you're needing to constantly test parameter types - Then you need to work harder on ensuring your input is the correct type before calling a method. It should subconsciously tell you to put more effort into knowing what you're working with.

Unit tests are meant to test behavior - When I do X, I want Y to happen.

Rspec is great for this - I did X, I should see A, B, and C get called - and if they return to me this value then my final result should be Z.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: