From afdcc9d2a1b76a4f0051e527015e2029095e458a Mon Sep 17 00:00:00 2001 From: Clinton Wolfe Date: Thu, 4 Jun 2020 15:03:16 -0400 Subject: [PATCH] Add cli to list of valid types explicitly to fix unit tests Signed-off-by: Clinton Wolfe --- lib/inspec/config.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/inspec/config.rb b/lib/inspec/config.rb index 3765ed344..845d9727e 100644 --- a/lib/inspec/config.rb +++ b/lib/inspec/config.rb @@ -355,7 +355,12 @@ module Inspec .find_activators(plugin_type: :reporter)\ .map(&:activator_name).map(&:to_s) - valid_types = rspec_built_in_formatters + inspec_reporters_that_are_not_yet_plugins + plugin_reporters + # Include CLI explicitly, because it is the default reporter and will usually not be + # present on the command line, and thus its plugin will not appear on the list. + valid_types = rspec_built_in_formatters + \ + inspec_reporters_that_are_not_yet_plugins + \ + plugin_reporters + \ + [ "cli" ] reporters.each do |reporter_name, reporter_config| raise NotImplementedError, "'#{reporter_name}' is not a valid reporter type." unless valid_types.include?(reporter_name)