From 8eaa209e2cc884eb128e5cd3807e8ff66d4191ad Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 5 Aug 2022 15:37:16 +0200 Subject: [PATCH] Add rspec-github integration This adds rspec-github as a dependency and at runtime it is optionally configured. The detection is the same as for Rubocop. --- lib/puppetlabs_spec_helper/module_spec_helper.rb | 4 ++++ puppetlabs_spec_helper.gemspec | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/puppetlabs_spec_helper/module_spec_helper.rb b/lib/puppetlabs_spec_helper/module_spec_helper.rb index 22a65459..764ec346 100644 --- a/lib/puppetlabs_spec_helper/module_spec_helper.rb +++ b/lib/puppetlabs_spec_helper/module_spec_helper.rb @@ -62,6 +62,10 @@ def verify_contents(subject, title, expected_lines) end RSpec.configure do |c| + if ENV['GITHUB_ACTIONS'] == 'true' + c.formatter = 'RSpec::Github::Formatter' + end + c.environmentpath = spec_path if Puppet.version.to_f >= 4.0 c.module_path = module_path c.manifest_dir = File.join(fixture_path, 'manifests') diff --git a/puppetlabs_spec_helper.gemspec b/puppetlabs_spec_helper.gemspec index a5a61857..ab3a42d9 100644 --- a/puppetlabs_spec_helper.gemspec +++ b/puppetlabs_spec_helper.gemspec @@ -32,5 +32,6 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'pathspec', '~> 1.0' spec.add_runtime_dependency 'puppet-lint', '~> 3.0' spec.add_runtime_dependency 'puppet-syntax', '~> 3.0' + spec.add_runtime_dependency 'rspec-github', '~> 2.0' spec.add_runtime_dependency 'rspec-puppet', '~> 2.0' end