simplecov icon indicating copy to clipboard operation
simplecov copied to clipboard

False positives for `begin` lines, a constant definition, and some heredoc content

Open keithrbennett opened this issue 2 years ago • 0 comments

Hi, I am using RSpec with JRuby 9.4.3.0. The code base on which it is running is as of the following commit in my open source 'rika' gem: https://github.com/keithrbennett/rika/commit/fadcf6c3cf263bb108f7be9a0900a1ef75da5c0e . I have the false positive problems listed below, but I may very well be mistaken in my use of simplecov somehow -- for example, I am surprised that 'spec' files show up in the output:

image


begin Lines

I have a problem with SimpleCov flagging begin lines in begin/ensure/end sections as untested:

image


HEREDOC lines

In addition, I think these HEREDOC lines are false positives as well; I have tested that the method in the first image is called, and that the text it returns is included in the output:

image

image


Constant Definitions

Also, a constant definition seems to be flagged falsely, even though its value has been explicitly tested, both for its content and for its frozen state:

image


My Setup

My spec_helper.rb has at its top:

require 'simplecov'

SimpleCov.start

I am running RSpec using JRUBY_OPTS=--debug bundle exec rspec.

Simplecov gem versions I am using are:

gem list simplecov

*** LOCAL GEMS ***

simplecov (0.22.0)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)

Ruby description is:

jruby 9.4.3.0 (3.1.4) 2023-06-07 3086960792 OpenJDK 64-Bit Server VM 17.0.8.1+1-Ubuntu-0ubuntu122.04 on 17.0.8.1+1-Ubuntu-0ubuntu122.04 +jit [x86_64-linux]

Thanks for any help with this.

keithrbennett avatar Sep 06 '23 05:09 keithrbennett