Add cli to list of valid types explicitly to fix unit tests

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2020-06-04 15:03:16 -04:00
parent 458a5c4410
commit afdcc9d2a1

View file

@ -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)