inspec/test/artifact/inspec_detect_test.rb
Miah Johnson 13a1c30ba6 Corret build scripts
correct path to hab artifact
Rather than throwing, lets try to install the version
Make sure hab is in the path
we use -b on windows. lets be consistent
export project_root too
picardface
fix regex
execute rake _through_ habitat
make test vrooom
test presence of inspec
strip out clixml bs
... no which on bk.
full path to which
export PATH
test exist on linux/windows

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-11-07 10:09:35 -08:00

24 lines
544 B
Ruby

require "minitest/autorun"
class TestArtifactDetect < Minitest::Test
def test_inspec_exists_linux
skip if windows?
refute_match(/no inspec/, `/usr/bin/which inspec`)
end
def test_inspec_exists_windows
skip unless windows?
assert_match(/inspec.bat/, `Get-Command inspec`)
end
def test_detect
exit = nil
out, err = capture_subprocess_io do
exit = system("inspec detect --no-color")
end
assert_empty err.sub(/#< CLIXML\n/, "")
assert_match(/Platform Details/, out)
assert exit
end
end