Tighten help listing assertion and adjust chomp

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-08-23 11:07:10 -04:00
parent 569f459eba
commit e346b16114
2 changed files with 2 additions and 4 deletions

View file

@ -158,7 +158,7 @@ module Inspec
end
input_name, input_value = pair.split("=")
evt = Inspec::Input::Event.new(
value: input_value.sub(/,$/, ""), # Trim trailing comma if any
value: input_value.chomp(","), # Trim trailing comma if any
provider: :cli,
priority: 50
)

View file

@ -46,9 +46,7 @@ describe "inputs" do
it "includes the --input option" do
result = run_inspec_process("exec help", lock: true) # --no-create-lockfile option breaks usage help
lines = result.stdout.lines
line = lines.detect { |l| l.include? "--input" }
line.wont_be_nil
assert_match(/--input\s/, result.stdout) # Careful not to match --input-file
end
end