simplecov-ruby / simplecov

Code coverage for Ruby with a powerful configuration library and automatic merging of coverage across test suites

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PR suggestion- show which spec executed a code.

thebravoman opened this issue · comments

simple cov shows the number of time a code was executed, but not which spec was responsible for executing this code.
I could not find this as a feature and I thought it will be interesting for us to implement it.

Would this be accepted as a PR?

You click on the "Number of times the line was executed" and you see a table of the specs that were running when the line was touched, possibly even the stack trace.

What this will allow us is to quickly see which specs are testing a certain method.

In our new project there are a lot of specs both system and model and some of the code is tested through system specs but because system specs test a lot of things and test a feature on a high level it is difficult to quickly understand which system spec tested what.

This also allows us to identify cases where we are overtesting. Probably a few system specs are doing similar things and we can easily get rid of them and reduce the number of specs we have to support and also the execution time of the specs.

Let me know your thoughts