mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
13a1c30ba6
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>
24 lines
544 B
Ruby
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
|