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
1
vote
1 answer

Rspec testing find_or_create method

I've checked my simplecov result and I've seen that record = User.where("fb_id = ? or email = ? ", params[:fb_id], params[:email]).first_or_create do |rows| rows.first_name = params[:first_name] rows.last_name =…
dsounded
  • 703
  • 5
  • 21
1
vote
2 answers

JRuby rspec: How to use --debug option for complete coverage

when i issue following command jruby -S rspec It run with following warning C:/jruby-1.7.4/lib/ruby/gems/shared/gems/simplecov-0.7.1/lib/simplecov.rb:34 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag So…
Kanti
  • 1,062
  • 1
  • 10
  • 27
1
vote
1 answer

simplecov custom filter group to report ignored code

I am trying to create a report in simplecov to report on rogue actions within my application. Basically I want a tab that reports any and only files that use the :nocov: parameter to prevent simplecov from reporting it. Now, I know these may not…
Chris Hough
  • 3,389
  • 3
  • 41
  • 80
1
vote
1 answer

rails rspec tests for lib class used by routes contains private methods

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
1
vote
2 answers

SimpleCov :: Periodic Coverage Report

I have a requirement where in, i need to get the coverage so far. If I stop the server, the report gets generated and I do get the coverage so far. But if i start the server again, my previous coverage results are lost and I can only get the…
Ramya AT
  • 159
  • 3
  • 15
1
vote
1 answer

Simplecov gem using obsolete lockfile boolean argument

I have an application which I have just added Simplecov to in order to get code coverage stats. After adding this Gem, I began getting the following errors: /Users/KristaOdger/.rvm/gems/jruby-1.7.6/gems/lockfile-2.1.0/lib/lockfile.rb:72 warning:…
Krista
  • 895
  • 1
  • 6
  • 16
1
vote
2 answers

How to write rspec testing without database in ruby for this ruby code

I am creating a ruby project with the class which is the inheritance of ActiveRecord::Base. How can i write rspec testing and simple coverage for the following code sample without using database. class Person < ActiveRecord::Base …
Soe Naing
  • 11
  • 4
0
votes
0 answers

I am not able to install any new gem in my rails application.Its a issue related to bundler

Bundler could not find compatible versions for gem "bundler": In Gemfile: rails (~> 5.2) was resolved to 5.2.3, which depends on bundler (>= 1.3.0) solargraph was resolved to 0.38.0, which depends on bundler (>= 1.17.2) …
0
votes
1 answer

Simplecov filter all controllers except certain ones

I am working on a Rails project that has some older code, but I only want to see the coverage of the controllers that I am working on. For example, the structure will be: controllers/ api/ whatever1/ whatever2/ a_controller.rb …
Victor Motogna
  • 731
  • 1
  • 12
  • 22
0
votes
0 answers

SimpleCov coverage generated using RubyMine with one tab

MacOS Monterey 12.6, RubyMine 2022.2.3, simplecov (0.12.0), test framework: rspec Used simplecov configuration: # spec_helper.rb require 'simplecov' SimpleCov.start 'rails' Question: Why generating report with RM puts all in one tab? IS there any…
Goaul
  • 943
  • 11
  • 13
0
votes
0 answers

How do I solve this rspec-support version error?

When I try running the rspec file of a task of my ruby application by using the command rspec /Users/priyanshu.sahoo/Desktop/Fk/ltl-worker/spec/tasks/four_kites_common/background_job/tasks/calculate_auto_delivery_appointment_time_task_spec.rb I…
0
votes
1 answer

Simplecov with docker

We recently migrated an app that we have to docker, and docker-compose. While without docker, we used to run tests using rspec spec for example, while using docker we'd do the same thing using docker-compose run app rspec spec Now, in the old…
mrateb
  • 2,317
  • 5
  • 27
  • 56
0
votes
1 answer

Where can I find the gem package for simplecov that are supporting ruby 1.8

I have a rather old ruby 1.8.7 + Rails 2.3.8 project which I still need to support. In the project there is a lot of unit test which I use. And, I would like to have a code coverage report as I had for many years ago using SimpleCov. But I cannot…
0
votes
0 answers

Getting NameError: undefined method `start' for class `#'

Added below configuration in spec_helper.rb on top of file. require 'simplecov' SimpleCov.start 'rails' I am trying to generate the specs coverage report using SimpleCov. Installed simplecov gem too. Rails version is 5. Still not able to generate…
0
votes
1 answer

Simplecov not generating reports in gitlab in proper format

I'm using simplecov to generate test reports for my ruby project in gitlab. The reports are getting generate successfully but the output is not in proper format. while in my localhost, it's generating output in the proper format. Any idea why this…