fix skip message not being passed for merge (#3329)

* fix skip message not being passed for merge
* Fix calling method twice

Signed-off-by: Noel Georgi <git@frezbo.com>
This commit is contained in:
Noel Georgi 2018-08-29 23:02:22 +05:30 committed by Jared Quick
parent 4e60ecb0f0
commit 0d951e1fd1

View file

@ -227,9 +227,10 @@ module Inspec
# all checks that were defined in the destination
sc = checks(src)
dst.instance_variable_set(:@__checks, sc) unless sc.empty?
# we need only the value of result not the Hash containing value and message
sr = skip_status(src)[:result]
set_skip_rule(dst, sr) unless sr.nil?
skip_check = skip_status(src)
sr = skip_check[:result]
msg = skip_check[:message]
set_skip_rule(dst, sr, msg) unless sr.nil?
# Save merge history
dst.instance_variable_set(:@__merge_count, merge_count(dst) + 1)