[LRUG] Number of tests over time?

Tim Cowlishaw tim at timcowlishaw.co.uk
Wed Mar 25 07:45:59 PDT 2015


On 25 March 2015 at 14:39, Frederick Cheung <frederick.cheung at gmail.com>
wrote:
>
> I’m interested in this too. If I say that foo should happen when a new
> user signs up, then I write my spec, add my feature and everything is
> great. Some months later I remove this - would people write a spec to say
> that foo no longer happens or just delete the spec that says that foo
> should happen. I usually do something approaching the former - I want to be
> confident that I’ve actually done what I’ve intended, but that feels like
> an example of what you’re talking about - once i’m confident the feature
> has been removed, the value of specs saying that it’s not there seems
> minimal
>

FWIW I find using a strongly mock-ist style of unit testing helps massively
with this. If I make a change that removes a method "foo", then remove all
the calls saying `allow(bar).to receive(:foo)` from my tests where the
receiver of 'foo' is mocked, I don't need to add an `expect(bar).not_to
receive(:foo)` as the mocks will already blow up if they receive a call to
'foo' as it hasn't been mocked.

Cheers!

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20150325/95efed90/attachment.html>


More information about the Chat mailing list