3 ms·
> I suppose it could be useful in cases where you'd stubbed out B in your specs, but ehhhh. You're talking like that's rare and not something people constantly
by emodendroket 5y ago
> I suppose it could be useful in cases where you'd stubbed out B in your specs, but ehhhh.
You're talking like that's rare and not something people constantly do when writing tests in Ruby.
- JohnBooty 5y agoIt is of course super common. Unit tests should be stubbing out as much as possible/reasonable. The presumption is that we're talking about a well rounded test suite with both unit tests and integration tests, and the integration tests would indeed be catching the fact that A is passing entirely the wrong thing to B. Of course, this does mean we're leaning heavily on the test suite here. But, in any nontrivial application I hope that we would have a robust test suite, right? Otherwise we're going to have some problems whether we're statically or dynamically typed.
- emodendroket 5y agoOver time I have come to view mock- and stub-heavy tests as next to worthless.