File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33require 'simplecov'
44require 'json'
55
6- # simplecov >= 1.0 ships its own simplecov_json_formatter.rb shim that can win
7- # the require over the standalone gem depending on $LOAD_PATH order. Require the
8- # standalone gem's classes by their subpaths (which simplecov does not ship) so
9- # the SimpleCovJSONFormatter::* constants are always present.
6+ # SimpleCov ships its own simplecov_json_formatter.rb shim that can shadow the
7+ # standalone gem on $LOAD_PATH. Require the gem's classes by subpath (which the
8+ # shim does not define) so the SimpleCovJSONFormatter::* constants are present.
109require 'simplecov_json_formatter/result_hash_formatter'
1110require 'simplecov_json_formatter/result_exporter'
1211
@@ -120,9 +119,9 @@ class << self
120119 attr_accessor :output_filename
121120 end
122121
123- # Own #format instead of inheriting SimpleCov::Formatter::JSONFormatter's:
124- # simplecov >= 1.0 reimplemented it to bypass #format_result and always
125- # write coverage.json, dropping undercover's meta and custom filename.
122+ # Own #format instead of inheriting SimpleCov::Formatter::JSONFormatter's,
123+ # which bypasses #format_result and always writes coverage.json, dropping
124+ # undercover's meta and custom filename.
126125 def format ( result )
127126 result_hash = format_result ( result )
128127 SimpleCovJSONFormatter ::ResultExporter . new ( result_hash ) . export
Original file line number Diff line number Diff line change @@ -244,10 +244,9 @@ def matches?(_source_file)
244244 end
245245end
246246
247- # Integration coverage for the actual SimpleCov filtering path (skip), without
248- # stubbing SimpleCov::Result#apply_filters!. This is the path that broke on
249- # SimpleCov >= 1.0 when filtering moved out of SimpleCov.filtered into
250- # SimpleCov::Result#apply_filters!, leaving ignored_files empty.
247+ # Integration coverage for the real SimpleCov filtering path (skip) via
248+ # SimpleCov::Result#apply_filters!, without stubbing -- this is what populates
249+ # ignored_files.
251250RSpec . describe 'ignored_files through the real SimpleCov filtering path' do
252251 let ( :kept_file ) { File . expand_path ( 'lib/undercover.rb' , SimpleCov . root ) }
253252 let ( :string_filtered ) { File . expand_path ( 'lib/undercover/version.rb' , SimpleCov . root ) }
You can’t perform that action at this time.
0 commit comments