Mutational testing of ActiveRecord mutant pearl models

I tried to start mutation testing for our rails application, but could not get it to work - did anyone manage to install this?

Here is what I have tried so far:

mutant -I app/models -r foo "Foo#bar" foo_spec.rb .../trunk/app/models/foo.rb:24:in `<top (required)>': uninitialized constant ActiveRecord (NameError) 

I also tried loading the activerecord nugget directly using -I, this stone is already installed in the current gemset rvm. I have the feeling that this will require a more complete setup to use database.yml, unfortunately, I can not find anyone who has already done this.

+4
source share
1 answer

Disclaimer: Mutant author speaking here.

Assuming you are using rails with rspec, you can test your models using the following command line:

RAILS_ENV=test bundle exec mutant -r ./config/environment --use rspec YourModel

There is a README section explaining rail integration. In case of problems, please visit to make sure you have the latest instructions.

+2
source

All Articles