inspec/test/artifact/artifact_helper.rb
Miah Johnson c993f91ca6 rubocop is on the beat
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-11-22 12:48:56 -08:00

19 lines
554 B
Ruby

require "minitest/autorun"
require "open3"
TEST_CLI_OPTS = "--chef-license=accept-no-persist".freeze
class ArtifactTest < Minitest::Test
make_my_diffs_pretty!
def assert_artifact(inspec_command)
command = "inspec #{inspec_command} #{TEST_CLI_OPTS}"
stdout, stderr, status = Open3.capture3({ "PATH" => ENV["PATH"] },
command,
{ chdir: ENV["project_root"] })
assert_empty stderr.sub(/#< CLIXML\n/, "")
assert stdout
assert status
end
end