Skip to content

Technical/Fix documentation formatters usage example - #1096

Merged
PragTob merged 1 commit into
simplecov-ruby:mainfrom
bestwebua:technical/fix-documentation-formatters-usage-example
Jun 22, 2024
Merged

PragTob merged 1 commit into
simplecov-ruby:mainfrom
bestwebua:technical/fix-documentation-formatters-usage-example

Conversation

@bestwebua

Copy link
Copy Markdown
Contributor

This PR is created in order to have up to dated documentation. Following to the code under the hood:

def formatters=(formatters)
@formatter = SimpleCov::Formatter::MultiFormatter.new(formatters)
end

For SimpleCov.formatters call examples in the current documentation we need to use array of formatters:

SimpleCov.formatters = [
  SimpleCov::Formatter::HTMLFormatter,
  SimpleCov::Formatter::CSVFormatter,
]

instead of instance of SimpleCov::Formatter::MultiFormatter:

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
  SimpleCov::Formatter::HTMLFormatter,
  SimpleCov::Formatter::CSVFormatter,
])

@PragTob

PragTob commented Jun 22, 2024

Copy link
Copy Markdown
Collaborator

Heyo, thanks for the fix!

@PragTob
PragTob merged commit 5de91ff into simplecov-ruby:main Jun 22, 2024
@bestwebua
bestwebua deleted the technical/fix-documentation-formatters-usage-example branch June 22, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants