3 ms·
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 ty
by tjbiddle 13y ago
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.