Fixes lint failure and test failures which was causing as it's enable to modify the Frozen String literal.

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasu1105 2022-05-10 14:54:31 +05:30
parent 0b587a98af
commit a78164927f
2 changed files with 3 additions and 2 deletions

View file

@ -93,7 +93,8 @@ class Inspec::InspecCLI < Inspec::BaseCLI
o["log_location"] = $stderr
configure_logger(o)
what = o[:what] || "profile"
# using dup to resolve "can't modify frozen String" error.
what = o[:what].dup || "profile"
what.downcase!
raise Inspec::Error.new("Unrecognized option '#{what}' for --what - expected one of profile, readme, or metadata.") unless %w{profile readme metadata}.include?(what)

View file

@ -747,7 +747,7 @@ module Inspec
end
def readme
@source_reader.readme&.values.first
@source_reader.readme&.values&.first
end
def metadata_src