Skip to content

Commit

Permalink
Make simplecov-json as optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Oct 30, 2024
1 parent 5a0e5cb commit 898ee6e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/lib/helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
require "simplecov"

# Cannot use ".simplecov" file: simplecov-json triggers a circular require.
require "simplecov-json"
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::JSONFormatter,
])
begin
require "simplecov-json"
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::JSONFormatter,
])
rescue LoadError
# for `make test-bundled-gems` in ruby-core repository.
# That task does not install C extension gem like json.
end

SimpleCov.start do
command_name "Net::IMAP tests"
Expand Down

0 comments on commit 898ee6e

Please sign in to comment.