fixed bug in --no-diff behavior

Signed-off-by: Will Dower <wdower@mitre.org>
This commit is contained in:
Will Dower 2022-02-25 16:06:15 -05:00
parent ec76259eb1
commit 22944c33b8

View file

@ -64,8 +64,8 @@ module Inspec
p[:controls]&.each do |c|
c[:results]&.each do |r|
next unless r[:message] # :message only set on failure
pos = r[:message].index("\n\nDiff:")
#require 'pry'; binding.pry
pos = r[:message].index(/\n{1,2}Diff.*:/)
next unless pos # Only textual tests get Diffs
r[:message] = r[:message].slice(0, pos)