mutant icon indicating copy to clipboard operation
mutant copied to clipboard

Ability to skip/whitelist mutations

Open plexus opened this issue 9 years ago • 3 comments

We just ran into an interesting case, there's code that uses const_get(foo, false). The false prevents lookup in ancestors.

Replacing false with nil also works, but is undocumented. It is less clear, and might break in the future. So leaving the false in we have live mutant.

So, what to do? Would you replace it with nil anyway? Do we need some way to flag that this statement should not be mutated?

plexus avatar May 09 '15 07:05 plexus

Mhh, you could always create a test like:

expect(that_object).to receive(:const_get).with(foo, false)

To "nail this specific API version".

But still yeah, we should have a mechanism to whitelist certain mutations. The infrastructure is there, the UI not.

mbj avatar May 09 '15 12:05 mbj

Yes, I would also really like that. I have a different reason for this. When I'm comparing Symbols, I would still like to use #==, even though I could use #equal? (but I can't use #== because I'll still have living mutants).

janko avatar May 19 '15 14:05 janko

I like the idea, but I do not have a need to do it for my projects. So tagging as not-on-authors-free-time to encourage funding or (preferred) outside contribution.

mbj avatar Aug 08 '15 21:08 mbj