sj26 / rspec_junit_formatter

RSpec results that your CI can read

Home Page:http://rubygems.org/gems/rspec_junit_formatter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I configure this formatter using RSpec.configure instead of CLI options?

jayhendren opened this issue · comments

I'm running my RSpec tests via a tool (TestKitchen) that only supports RSpec configuration via a spec_helper.rb file where one can configure RSpec using RSpec.configure blocks. It supports neither custom CLI flags/arguments to rspec nor .rspec files. I would still like to get jUnit output with my TestKitchen tests. Is there any way to use Rspec.configure to configure RspecJunitFormatter? I'm thinking something along the lines of the following:

RSpec.configure do |c|
  c.formatter = 'RspecJunitFormatter'
  c.output = '/path/to/output.xml'
end

I got this figured out:

RSpec.configure do |c|
  c.add_formatter('RspecJunitFormatter', '/path/to/output.xml')
end