mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
adding a shell extension class of the rspec_junit_formatter gem formatter and including it in the formatters list with key 'junit'
Signed-off-by: jkerry <john@kerryhouse.net>
This commit is contained in:
parent
deff8c9e6e
commit
e5038e1e5d
4 changed files with 15 additions and 0 deletions
1
Gemfile
1
Gemfile
|
@ -15,6 +15,7 @@ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2')
|
|||
end
|
||||
|
||||
gem 'ffi', '>= 1.9.14'
|
||||
gem 'rspec_junit_formatter', '~> 0.2.3'
|
||||
|
||||
group :test do
|
||||
gem 'bundler', '~> 1.5'
|
||||
|
|
|
@ -37,4 +37,5 @@ Gem::Specification.new do |spec|
|
|||
spec.add_dependency 'mixlib-log'
|
||||
spec.add_dependency 'sslshake', '~> 1'
|
||||
spec.add_dependency 'parallel', '~> 1.9'
|
||||
spec.add_dependency 'rspec_junit_formatter', '~> 0.2.3'
|
||||
end
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
require 'rspec/core'
|
||||
require 'rspec/core/formatters/json_formatter'
|
||||
require 'rspec_junit_formatter'
|
||||
|
||||
# Vanilla RSpec JSON formatter with a slight extension to show example IDs.
|
||||
# TODO: Remove these lines when RSpec includes the ID natively
|
||||
|
@ -547,3 +548,14 @@ class InspecRspecCli < InspecRspecJson # rubocop:disable Metrics/ClassLength
|
|||
data
|
||||
end
|
||||
end
|
||||
|
||||
class InspecRspecJUnit < RSpecJUnitFormatter
|
||||
RSpec::Core::Formatters.register self, :close
|
||||
|
||||
def initialize(*args)
|
||||
super(*args)
|
||||
end
|
||||
|
||||
def close(_notification)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -103,6 +103,7 @@ module Inspec
|
|||
'json' => 'InspecRspecJson',
|
||||
'json-rspec' => 'InspecRspecVanilla',
|
||||
'cli' => 'InspecRspecCli',
|
||||
'junit' => 'InspecRspecJUnit',
|
||||
}.freeze
|
||||
|
||||
# Configure the output formatter and stream to be used with RSpec.
|
||||
|
|
Loading…
Reference in a new issue