From 2fe0094089f5268ae52de0c7dc95a2660f26b996 Mon Sep 17 00:00:00 2001 From: Brooke Kuhlmann Date: Fri, 17 Jul 2026 09:33:24 -0600 Subject: [PATCH] Updated to SimpleCov 1.0.0 link:https://github.com/simplecov-ruby/simplecov[Details]. We have to capture the `ArgumentError` when SimpleCov exits because Liquid violates the _Liskov Substitution Principle_ due to expecting an object to be passed into the `#inspect` method which breaks the expectation of `Object` (superclass). _This only happens in CI, not locally._ Created an link:https://github.com/Shopify/liquid/issues/2107[issue] to track this. Until the Liquid issue is resolved, this does mean that _no_ SimpleCov artifact will be generated in CI. Milestone: minor --- Gemfile | 2 +- spec/spec_helper.rb | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index af9451d..623e064 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ group :quality do gem "caliber", "~> 0.88" gem "git-lint", "~> 11.0" gem "reek", "~> 6.5", require: false - gem "simplecov", "~> 0.22", require: false + gem "simplecov", "~> 1.0", require: false end group :development do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dd38879..1577f56 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,14 +3,18 @@ require "simplecov" unless ENV["COVERAGE"] == "no" - SimpleCov.start do - add_filter %r(^/spec/) - enable_coverage :branch - enable_coverage_for_eval - minimum_coverage_by_file line: 95, branch: 69 + SimpleCov.start :strict do + minimum_coverage branch: 70 end end +# TODO: Remove once the Liquid gem is fixed because it violates Object#inspect behavior. +SimpleCov.at_exit do + SimpleCov.result.format! +rescue ArgumentError => error + warn "Liquid object inspection failure: #{error.message}" +end + Bundler.require :tools require "refinements"