Dipak Panchal
Dipak Panchal

Reputation: 6036

How to change Coverage class for SimpleCov

I am getting Coverage is not a class (TypeError)

I have already a coverage class in my model and I added gem 'SimpleCov' and when I run Spec then Getting Coverage is not a class (TypeError).

The error comes because of coverage class in my model. so Is there any way to change coverage class in SimpleCov and give another name for that class?

Thanks In Advance

Upvotes: 1

Views: 344

Answers (2)

mvidaurre
mvidaurre

Reputation: 489

Could you namespace your Coverage class? In that way will not be collision. You will need refactor your code.

Upvotes: 0

Dan Kohn
Dan Kohn

Reputation: 34327

The author of simplecov stated that the Coverage class is in Ruby and so this is not something he can fix. I would suggest refactoring your schema to rename your Coverage class.

Upvotes: 2

Related Questions