Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SimpleCov rspec and cucumber separately

Could you tell me how to setup simplecov to test models with rspec and controller with cucumber only? I don't like it that rspec and cucumber coverage are mixed together...

like image 712
BvuRVKyUVlViVIc7 Avatar asked Jan 21 '23 10:01

BvuRVKyUVlViVIc7


1 Answers

SimpleCov.coverage_dir ‘coverage’

This will allow you to set the directory where the coverage information will go. So one way to configure it will be to put

if RUBY_VERSION > "1.9"
  require 'simplecov'
  SimpleCov.start 'rails'
  SimpleCov.coverage_dir 'coverage/rspec'
end

inside of your test_helper, and

if RUBY_VERSION > "1.9"
  require 'simplecov'
  SimpleCov.start 'rails'
  SimpleCov.coverage_dir 'coverage/cucumber'
end

inside of features/support/env.rb

That should separate them. You probably also want to make sure to run the tests separately so that it doesn't merge them.

like image 198
Jonathon Jones Avatar answered Jan 26 '23 00:01

Jonathon Jones