Questions tagged [simplecov]

Simplecov is a code coverage tool for Ruby 1.9+.

Simplecov is a code coverage tool for Ruby 1.9+ with a powerful configuration library and automatic merging of coverage across test suites.

https://github.com/colszowka/simplecov

https://www.ruby-toolbox.com/projects/simplecov

95 questions
34
votes
3 answers

Simple cov gem missing untested files in Rails

Using simple_cov gem in a Rails app, can we have the files that we are not testing included in the report? If yes, how? If no, that files should count to the coverage percentage, right ?
Gustavo Semião-Lobo
  • 2,468
  • 3
  • 18
  • 26
27
votes
1 answer

How to check RSpec code coverage in Rails application?

I'm working on my very first simple Rails app. And now I just did my homework which I should do before anything else - RSpec tests. I delayed it on purpose because of no experience I even wasn't sure what for and how to do RSpec tests. Finally, I…
pawel7318
  • 3,383
  • 2
  • 28
  • 44
21
votes
2 answers

Exclude vendor files from Simplecov reports

I just want to exclude the vendor gems from being shown with the coverage report, how to do that? Here is how my coverage report looks like:
Wazery
  • 15,394
  • 19
  • 63
  • 95
20
votes
8 answers

SimpleCov calculate 0% coverage for user model

I decided to try using simplecov gem, and I think it's a cool tool, but I have one problem: I have a model User, and I have user_spec.rb which contains test cases, but simplecov shows 0% coverage of this model. And it shows 100% coverage for other…
eugene_trebin
  • 1,485
  • 1
  • 16
  • 29
12
votes
1 answer

How to configure SimpleCov to ignore #inspect methods

My coverage report is not at 100% because I have a couple of #inspect methods in my classes which I use for debugging purposes. Is there a way to configure SimpleCov to ignore all the inspect methods?
Omar Rodríguez
  • 173
  • 1
  • 6
12
votes
4 answers

Is there a way to add coverage report to gitlab?

I understand that gitlab has support to Jenkins CI, but what I need is a lot less than that. I have a Rails application and get the coverage from the tests using simplecov. It generates HTML output in a directory by running a rake task. I would…
fotanus
  • 19,618
  • 13
  • 77
  • 111
11
votes
4 answers

Ruby on Rails test coverage with simplecov

I want to analyse the test coverage of our code , and therefore, installed the simplecov gem. Our testing environement has 2 seperate project: REST API test (Java+Rest-Assured) and Web UI testing (Java-Selenium). As you can see, we dont have unit…
YogevAbr
  • 289
  • 3
  • 18
6
votes
1 answer

simplecov report 0.0% covered

I'm working on a small plugin and included simplecov. In my gem file I have the line: gem 'simplecov', :require => false, :group => :test In my test file I put the line require "projectname/devuntil/rspec/spec_helper" at the very top of the file.…
Hoang Speed
  • 191
  • 2
  • 12
6
votes
2 answers

How to integrate simplecov with a Ruby gem using RSpec (no rails)?

When adding simplecov to a rails project using RSpec, I'd place this at the very top of rails_helper.rb require 'simplecov' SimpleCov.start 'rails' do add_filter '/spec/' add_group 'Controllers', 'app/controllers' add_group 'Models',…
Epigene
  • 3,634
  • 1
  • 26
  • 31
6
votes
1 answer

In statement "33.08% covered at 12.13 hits/line" what does hits/line mean?

Recently I was working with rails project , and generated a code coverage report using simplecov, I got a nice report , below. I know it's a simple question ( I googled many times but not getting any proper explanation) can anyone explain what…
Avinash Agrawal
  • 1,038
  • 1
  • 11
  • 17
5
votes
1 answer

code coverage of new lines between 2 commits in ruby

I would like to ensure that all new lines written added are covered by test. Is there a simple way to do an intersection between git diff and simplecov coverage. http://fredwu.me/post/35625566267/simplecov-test-coverage-for-changed-files-only…
trax
  • 739
  • 8
  • 21
5
votes
3 answers

How to merge multiple simplecov directories inside CircleCI when running parallel_test?

I have a rails application that runs parallel_test with rspec inside circleci Looking around on Internet I added up this to the very beginnging of my spec_helper.rb file: if ENV['COVERAGE'] require 'simplecov' # on circleci change the output dir…
fabrizioM
  • 46,639
  • 15
  • 102
  • 119
4
votes
1 answer

How to include a directory and your subdirectories with simplecov

How can I add folder and subfolders of my libs to simplecov generate the coverage? My SimpleCov Config SimpleCov.start do add_group 'Bot', 'app/bots' add_group 'Bot', 'lib/bot' add_group 'Controllers', 'app/controllers' add_group…
Luiz Carvalho
  • 1,549
  • 1
  • 23
  • 46
4
votes
0 answers

SimpleCov: load .resultset.json and output html

I would like to load a .resultset.json file and output the index.html that simplecov does when you run the test. I have not had success doing merging - it seems to only have the last result in the html coverage summary. I can create a resultset.json…
nroose
  • 1,689
  • 2
  • 21
  • 28
4
votes
1 answer

Coveralls coverage not matching SimpleCov

I'm using the 'simplecov' and 'coveralls' ruby gems but the report that is generated by simplecov doesn't match the report generated by coveralls. I've found that coveralls is not ignoring code that's wrapped in # :nocov: Here is my…
bsiddiqui
  • 1,886
  • 5
  • 25
  • 35
1
2 3 4 5 6 7