colszowka/simplecov — pull request #175 by scotje (2012-11-06 22:28:56+00:00)
Title: Makes SimpleCov resilient to inclusion of mathn library. (Re: #140)

Made sure SourceFile.covered_percent and FileList.covered_strength won't return Rationals even when 'mathn' has been included.

With the latest builds of MRI 1.9.3, it seems that dividing an Integer by a Float will return a Rational when 'mathn' is included, and calling .round() on a Rational currently causes a segfault.

Even though Rational.round shouldn't be segfaulting, it seems worthwhile to ensure that Simplecov returns a float for these methods with or without 'mathn' being present.

I understand if you would rather just wait for the core team to fix Rational.round, but this seemed like a simple enough fix to merit consideration.