mutant
mutant copied to clipboard
Ability to skip/whitelist mutations
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?
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.
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).
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.