mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
e77b99235f
This does the following to `inspec detect`: - Modifies it to use the `platform` resource - Changes the output to mention Platform and show the family hierarchy - Changes the JSON output by changing `family` to `families` - Adds better error messaging (no more stacktraces!) - Adds support for APIs such as AWS/Azure - Hides Arch from API platforms (not applicable) Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
31 lines
806 B
Ruby
31 lines
806 B
Ruby
# encoding: utf-8
|
|
|
|
require 'functional/helper'
|
|
|
|
describe 'command tests' do
|
|
include FunctionalHelper
|
|
|
|
describe 'version' do
|
|
it 'provides the version number on stdout' do
|
|
out = inspec('version')
|
|
out.stderr.must_equal ''
|
|
out.exit_status.must_equal 0
|
|
out.stdout.must_equal Inspec::VERSION+"\n"
|
|
end
|
|
|
|
it 'prints the version as JSON when the format is specified as JSON' do
|
|
out = inspec('version --format=json')
|
|
out.stderr.must_equal ''
|
|
out.exit_status.must_equal 0
|
|
out.stdout.must_equal %({"version":"#{Inspec::VERSION}"}\n)
|
|
end
|
|
end
|
|
|
|
describe 'check' do
|
|
it 'verifies that a profile is ok' do
|
|
out = inspec('check ' + example_profile)
|
|
out.stdout.must_match(/Valid.*true/)
|
|
out.exit_status.must_equal 0
|
|
end
|
|
end
|
|
end
|