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)
|
2019-09-30 22:31:55 +00:00
|
|
|
_(data.class).must_equal Array
|
|
|
|
_(data.size).must_be(:>, 1)
|
|
|
|
_(data[0]["name"]).must_equal "aix"
|
2019-06-11 22:24:35 +00:00
|
|
|
families = %w{aix unix os}
|
2019-09-30 22:31:55 +00:00
|
|
|
_(data[0]["families"]).must_equal families
|
2019-07-23 01:44:43 +00:00
|
|
|
|
2019-09-30 22:31:55 +00:00
|
|
|
_(out.stderr).must_equal ""
|
2019-07-23 01:44:43 +00:00
|
|
|
|
|
|
|
assert_exit_code 0, out
|
2018-09-13 19:36:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|