Hi,
I put this in my spec_helper.rb file:
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", FILE)
require 'rspec/rails'
begin
require 'simplecov'
SimpleCov.start('rails')
end
and run rspec command, but the result is simple just cover some file in models folders in my rails app, not cover all file in models folder.
How can I fix it?
Thanks,
Try putting these lines in a new order:
ENV["RAILS_ENV"] ||= 'test'
require 'simplecov'
SimpleCov.start('rails')
require File.expand_path("../../config/environment", FILE)
require 'rspec/rails'
Does this help?
I've tried that and the result is in local, simplecov cover all files in models but circleCI produces this error: 'Coverage disabled, enable by installing simplecov'.
I really don't know how to solve it.
hit up circleci support? Are you bundle execing your rspec?
There isn't really enough information here for us to help much more than that I'm afraid.
@ancv1990 Please review https://github.com/colszowka/simplecov/blob/master/CONTRIBUTING.md
Thanks, I will try
It works when I change rspec command in circle.yml from "rspec spec --format=doc" to 'bundle exec rspec'.
Thanks all,
So this issue can be closed?
Yes
Most helpful comment
Try putting these lines in a new order:
Does this help?