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
2
votes
0 answers

How to find out what caused the coverage drop in simplecov

We are using simplecov as our code coverage tool and it's great. One thing that would make it even better would be an output saying which file changes caused the drop in the coverage. One possible way would be to store .resultset.json files and…
Milos Blasko
  • 614
  • 10
  • 25
2
votes
2 answers

How to detect untested ruby files?

I recently started working on a large Rails application. Simplecov says test coverage is above 90%. Very good. However now and again I discover files that are not even loaded by the test suite. These files are actually used in production but for…
Samuel
  • 517
  • 3
  • 12
2
votes
2 answers

Rails 4 & SimpleCov: lib/tasks/cucumber.rake included in coverage report for SimpleCov?

I have the following code at the top of spec/spec_helper.rb and features/support/env.rb (SimpleCov merging RSpec & Cucumber coverage results): require 'simplecov' I also have the following code in a .simplecov file in the project…
r123454321
  • 3,323
  • 11
  • 44
  • 63
2
votes
1 answer

SimpleCove coverage not coming for only some models

I am having very weird issue with simple cov and rspec. I have following in my rails_hlper file require 'simplecov' SimpleCov.start 'rails' do add_filter "app/helpers/" add_filter "app/models/concerns/" add_group 'Models',…
jbmyid
  • 1,985
  • 19
  • 22
2
votes
1 answer

rails 4 simpecov missing files

I am a huge fan of testing and when I run my current coverage reports I noticed that my lib sub folders with .rb files are not being picked up by simplecov. Here is my setup in my spec_helper.rb file: if ENV['COVERAGE'] require 'simplecov' …
Chris Hough
  • 3,389
  • 3
  • 41
  • 80
2
votes
1 answer

How can I tell Simplecov to focus on specific directories in a Rails project?

The title mostly speaks for itself. To be more specific, it would seem to make sense to me that Simplecov be configured to only focus on directories like the app directory instead of including all of the configuration files and such that are going…
Ten Bitcomb
  • 2,316
  • 1
  • 25
  • 39
2
votes
1 answer

rspec test a private method within a private method that needs to be stubbed

Simplecov detected that I was missing some tests on my lib/api_verson.rb class: class ApiVersion def initialize(version) @version = version end def matches?(request) versioned_accept_header?(request) || version_one?(request) end …
Chris Hough
  • 3,389
  • 3
  • 41
  • 80
2
votes
2 answers

How does one configure Cucumber / Aruba to use SimpleCov?

Ruby-2.0.0p247 ActiveRecord-4.0.1 Cucumber 1.3.10 Aruba-0.5.3 SimpleCove-0.8.2 We use Cucumber with Aruba in a NON-RAILS project that nonetheless uses ActiveRecord. Our cucumber features exercise the code both in-process and out-of-process. The…
James B. Byrne
  • 1,048
  • 12
  • 27
2
votes
1 answer

Rspec SimpleCov NoMethodError

When running my rails 4 rspec suite via rake everything works correctly but when attempting to run rake simplecov I get hundreds of failures all w/ a NoMethodError something like: 1) Answer Validations Failure/Error: it { should…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
2
votes
1 answer

minitest with simplecov

I'm trying to test minitest files like this: COVERAGE=true ruby -Itest test/views/info_pages_test.rb COVERAGE=true ruby -Itest test/views/errors_test.rb now my info_pages_test has 97% coverage and my errors_test has 75% coverage. Together they…
sambehera
  • 959
  • 3
  • 13
  • 33
1
vote
0 answers

Why is Rspec and SimpleCov Model Coverage nearly 100% by default

I found that SimpleCov always flags all standard (i.e. nothing fancy like custom method validations) validations in the model(s) to be "fully hit / tested". This confuses me as I would've thought that one should be writing tests to hit every…
pandancode
  • 53
  • 5
1
vote
1 answer

Minitest hanging on stylesheet_link_tag

An error in Minitest is generated for four actions (index, show, new, edit) ActionView::Template::Error: Error: @supports condition expected declaration on line 9749:12 of stdin >> @supports (scroll-snap-type)…
Jerome
  • 5,583
  • 3
  • 33
  • 76
1
vote
1 answer

Simplecov not showing correct coverage in Rails 6

Simplecov doesn't seem to work with Rails 5 or 6 with the default settings, with the report showing 0% covered. What is the fix?
Carson Cole
  • 4,183
  • 6
  • 25
  • 35
1
vote
1 answer

SimpleCov Rspec coverage not handle prepend files

I am working with Spree gem and Rails 6. I create decorator for Spree::Variant and Spree::Product variant_decorator.rb: # frozen_string_literal: true module Spree module VariantDecorator def display_price_ca(currency =…
memoris
  • 149
  • 2
  • 12
1
vote
1 answer

Rails: SimpleCov failed with exit 1 - how to solve this

I'm upgrading a rails app from rails 4.2 to 5.0. then, on to 5.1, 5.2. It is using ruby 2.6.4. When I run my spec tests, I get the error: SimpleCov failed with exit 1. I cannot find any info specific to this using Google. I've read through the…
John Cowan
  • 1,452
  • 5
  • 25
  • 39