Skip to content

How to configure SimpleCov with Spring? #381

@onebree

Description

@onebree

Rails 4.2.0, RSpec 3.1, SimpleCov 0.9.2

I have the following in my rails_helper.rb file, outside of the RSpec.configure block

require 'simplecov'
SimpleCov.start 'rails' do
  add_filter '/app/models/legacy/'
  add_filter '/app/controllers/playlists_controller_legacy.rb'
  add_filter '/app/models/login.rb'
  add_filter '/app/models/login_auth.rb'
  add_filter '/app/models/login_config.rb'
end

I have read online that some people find running spring rspec returns high or even 100% coverage. It does not seem that way for our app, but I would just like to make sure. The LOC count seems a little low (short by 1000 maybe?), although again that could be from recent refactoring I have not viewed the commits for.

And my config/spring.rb file contains nothing about SimpleCov. Would I put the above configuration in the spring file itself, or under the Spring.after_fork block?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions