From 2388dc1a0df2723b37fe3348bef91c7dbb094138 Mon Sep 17 00:00:00 2001 From: Kuba Suder Date: Mon, 27 Jul 2026 23:58:19 +0200 Subject: [PATCH] updated simplecov config --- Gemfile | 2 +- spec/spec_helper.rb | 29 ++++++----------------------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/Gemfile b/Gemfile index 60bc1a8..a281557 100644 --- a/Gemfile +++ b/Gemfile @@ -13,5 +13,5 @@ gem 'rdoc' gem 'yard' gem 'mocha' -gem 'simplecov' +gem 'simplecov', require: false gem 'webmock' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 665c17b..f2b15a2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,10 +1,12 @@ # frozen_string_literal: true -require 'simplecov' +unless ENV["GITHUB_ACTIONS"] == "true" + require 'simplecov' -SimpleCov.start do - enable_coverage :branch - add_filter "/spec/" + SimpleCov.start do + enable_coverage :branch + formatter SimpleCov::Formatter::HTMLFormatter.new(silent: true) + end end require 'skyfall' @@ -21,23 +23,4 @@ RSpec.configure do |config| config.mock_with :mocha end -module SimpleCov - module Formatter - class HTMLFormatter - def format(result) - # silence the stdout summary, just save the html files - unless @inline_assets - Dir[File.join(@public_assets_dir, "*")].each do |path| - FileUtils.cp_r(path, asset_output_path, remove_destination: true) - end - end - - File.open(File.join(output_path, "index.html"), "wb") do |file| - file.puts template("layout").result(binding) - end - end - end - end -end - WebMock.enable! -- 2.51.2