2019-06-11 22:24:35 +00:00
|
|
|
require "functional/helper"
|
2018-09-13 19:36:17 +00:00
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
describe "inspec schema" do
|
2018-09-13 19:36:17 +00:00
|
|
|
include FunctionalHelper
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
describe "extracting the platforms schema export" do
|
|
|
|
it "can execute a platforms schema command" do
|
|
|
|
out = inspec("schema platforms")
|
2019-07-23 01:44:43 +00:00
|
|
|
|
2018-09-13 19:36:17 +00:00
|
|
|
data = JSON.parse(out.stdout)
|
|
|
|
data.class.must_equal Array
|
|
|
|
data.size.must_be(:>, 1)
|
2019-06-11 22:24:35 +00:00
|
|
|
data[0]["name"].must_equal "aix"
|
|
|
|
families = %w{aix unix os}
|
|
|
|
data[0]["families"].must_equal families
|
2019-07-23 01:44:43 +00:00
|
|
|
|
|
|
|
out.stderr.must_equal ""
|
|
|
|
|
|
|
|
assert_exit_code 0, out
|
2018-09-13 19:36:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|