Closed zherr closed 5 years ago
Any chance you tar up a sample project that produces the issue?
The spec file below produces a coverage report in both rspec v2 and v3 with no warning.
require 'simplecov'
require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
SimpleCov.start
require_relative '../lib/blah'
RSpec.describe "something" do
it "does something" do
end
end
Running your example command provides a different error for me, so I cannot reproduce your original issue
It looks to me as though you are trying to use this gem as an rspec formatter. That's not what it is. It's a formatter for simplecov.
If that is in fact your intent, take a look at the documentation @ https://github.com/colszowka/simplecov which tells you how to integrate simplecov with rspec (or this seems to offer a concise example as well - https://medium.com/the-code-review/display-your-ruby-test-coverage-using-simplecov-gem-and-codeclimate-6db6336fe409).
If I am off-base regarding your intent, please let me know.
Yes! Check this out: bug-7.zip
Once in the project directory, run:
bundle install
bundle exec rspec --format SimpleCov::Formatter::CoberturaFormatter
And you should see the warning.
The --format flag of rspec is to indicate the format of the rspec output. The simplecov cobertura formatter is NOT an rspec formatter, but is a simplecov formatter.
If you just run bundle exec rspec
from your sample project, you will see the simplecov output in coverage/coverage.xml
Thanks @jessebs , you're right! User error. Closing!
Full warning:
Reproduction steps:
bundle exec rspec --format SimpleCov::Formatter::CoberturaFormatter